Insights into IL-1 Family Cytokines in Kidney Allograft Transplantation: IL-18BP and Free IL-18 as Emerging Biomarkers
Statistical report - data exploration and statistical analysis
Authors’ affiliations:
Cecrdlova E1, Krupickova L1, Fialova M1, Novotny M2, Svachova V1, Mezerova K1, Tichanek F3, Viklicky O2, Striz I1
1Department of Clinical and Transplant Immunology
2Department of Nephrology
3Department of Data Science
Institute for Clinical and Experimental Medicine, Prague, Czech Republic
Original publication
This is statistical report of for the publication Insights into IL-1 family cytokines in kidney allograft transplantation: IL-18BP and free IL-18 as emerging biomarkers, cuurently accepted in the Cytokine journal
When using this code, cite original publication:
TO BE ADDED
Original GitHub repository: https://github.com/filip-tichanek/il1_TX
1 Packages and functions
Open code
if (T) {rm(list = ls() )}
if (T) {
suppressWarnings(suppressMessages({
library(tidyverse)
library(stringr)
library(ggpubr)
library(emmeans)
library(gtsummary)
library(car)
library(sjPlot)
library(flextable)
library(openxlsx)
library(mgcv)
library(pROC)
library(cowplot)
library(boot)
library(glmnet)
library(brms)
library(projpred)
library(RJDBC)
library(janitor)
library(arm)
library(corrplot)
library(lubridate)
library(kableExtra)
library(ggdist)
library(bayesplot)
library(coxed)
library(quantreg)
library(rstudioapi)
# Functions clashes
select <- dplyr::select
rename <- dplyr::rename
mutate <- dplyr::mutate
recode <- dplyr::recode
summarize <- dplyr::summarize
count <- dplyr::count
# Simple math functions
logit <-function(x){log(x/(1-x))}
inv.logit <- function(x){exp(x)/(1+exp(x))}
}))
}1.1 run_model function
The function to (i) load OR (ii) run & save (if has not been done previously) results of any computation
Open code
run <- function(expr, path, reuse = TRUE) {
# Initialize 'fit' to NULL to ensure it's always defined
fit <- NULL
# Construct the file path only if 'reuse' is TRUE
if (reuse) {
path <- paste0(path, ".Rds")
fit <- suppressWarnings(try(readRDS(path), silent = TRUE))
# Check if 'fit' is an error (file not found or couldn't be read)
if (inherits(fit, "try-error")) {
fit <- NULL
}
}
# If 'fit' is NULL (either because 'reuse' is FALSE, or the file couldn't be read), evaluate 'expr'
if (is.null(fit)) {
fit <- eval(substitute(expr))
# Save 'fit' only if 'reuse' is TRUE and a valid 'path' is provided
if (reuse && !is.null(path) && nzchar(path)) {
saveRDS(fit, file = path)
}
}
return(fit)
}1.2 Data upload
Open code
patient_table <- read.table('data/pat_data.txt')
patient_table <- patient_table %>% select(-c(Patient, date_of_rejection,
bid, Dg)) %>%
mutate(induction_therapy = factor(induction_therapy), # Ensure it's a factor
induction_therapy = fct_collapse(induction_therapy,
ATG = c("ATG", "ATG+ Infliximab", "ATG+Infliximab"),
basiliximab = "Simulect"))
summary(patient_table)
## id rejection_afterTX group receiver_sex
## Length:186 Min. : 6.00 Length:186 Length:186
## Class :character 1st Qu.: 17.25 Class :character Class :character
## Mode :character Median : 69.50 Mode :character Mode :character
## Mean :100.30
## 3rd Qu.:110.25
## Max. :505.00
## NA's :142
## receiver_age donor_sex donor_age N_mismatch
## Min. :22.00 Length:186 Min. : 1.00 Min. :0.000
## 1st Qu.:45.00 Class :character 1st Qu.:44.00 1st Qu.:2.250
## Median :56.50 Mode :character Median :55.00 Median :3.000
## Mean :54.67 Mean :52.80 Mean :3.304
## 3rd Qu.:65.00 3rd Qu.:64.75 3rd Qu.:4.000
## Max. :80.00 Max. :81.00 Max. :6.000
## NA's :48 NA's :48 NA's :48
## dsa anti_hla PRA_max PRA_actual
## Length:186 Length:186 Min. : 0.00 Min. : 0.0
## Class :character Class :character 1st Qu.: 2.25 1st Qu.: 0.0
## Mode :character Mode :character Median :10.00 Median : 2.0
## Mean :19.09 Mean :11.6
## 3rd Qu.:29.50 3rd Qu.:11.5
## Max. :98.00 Max. :92.0
## NA's :48 NA's :48
## hemodialysis_years TX_order ebv cmv
## Min. : 0.000 Min. :1.000 Length:186 Length:186
## 1st Qu.: 1.400 1st Qu.:1.000 Class :character Class :character
## Median : 2.300 Median :1.000 Mode :character Mode :character
## Mean : 3.047 Mean :1.109
## 3rd Qu.: 4.000 3rd Qu.:1.000
## Max. :11.900 Max. :4.000
## NA's :49 NA's :48
## CIT_hours MT_minutes induction_therapy tacrolimus
## Min. : 0.0 Min. : 7.00 ATG :77 Min. :0.0000
## 1st Qu.:12.0 1st Qu.:19.00 ATG,PE,IVIG:18 1st Qu.:1.0000
## Median :14.0 Median :24.00 basiliximab:43 Median :1.0000
## Mean :13.7 Mean :25.37 NA's :48 Mean :0.9783
## 3rd Qu.:16.0 3rd Qu.:29.75 3rd Qu.:1.0000
## Max. :24.0 Max. :57.00 Max. :1.0000
## NA's :48 NA's :48 NA's :48
## MMF mTOR dsa_at_tx dsa_de_novo
## Min. :0.0000 Min. :0.00000 Length:186 Length:186
## 1st Qu.:1.0000 1st Qu.:0.00000 Class :character Class :character
## Median :1.0000 Median :0.00000 Mode :character Mode :character
## Mean :0.9275 Mean :0.02174
## 3rd Qu.:1.0000 3rd Qu.:0.00000
## Max. :1.0000 Max. :1.00000
## NA's :48 NA's :48
## egfr_mean creatinine_mean il1_a_mean il1_b_mean
## Min. :0.1367 Min. : 53.0 Min. : 0.1751 Min. : 0.3786
## 1st Qu.:0.4558 1st Qu.: 119.0 1st Qu.: 1.4411 1st Qu.: 8.0770
## Median :0.6637 Median : 256.5 Median : 3.7232 Median :12.7858
## Mean :0.7722 Mean : 278.1 Mean : 5.0087 Mean :12.2006
## 3rd Qu.:0.9631 3rd Qu.: 360.2 3rd Qu.: 6.5541 3rd Qu.:14.7499
## Max. :1.8800 Max. :1172.8 Max. :46.6601 Max. :48.9390
##
## il1_ra_mean il18_mean il18_bp_mean il18_free_mean
## Min. : 1.355 Min. : 1.501 Min. : 1946 Min. : 77.51
## 1st Qu.: 667.896 1st Qu.: 278.570 1st Qu.: 2990 1st Qu.: 206.94
## Median : 1147.610 Median : 431.502 Median : 3438 Median : 317.76
## Mean : 1624.957 Mean : 653.351 Mean : 3587 Mean : 456.12
## 3rd Qu.: 2031.337 3rd Qu.: 782.363 3rd Qu.: 4009 3rd Qu.: 565.57
## Max. :12548.295 Max. :5015.730 Max. :11804 Max. :3279.54
## NA's :17 NA's :17
## il36_b_mean
## Min. : 0.0258
## 1st Qu.: 2.4952
## Median : 3.7044
## Mean : 5.0883
## 3rd Qu.: 5.7242
## Max. :53.5479
##
data_long <- read.table('data/long_data.txt')
data_long <- data_long %>% select(-Patient)
summary(data_long)
## id time_point group id_obs
## Length:596 Length:596 Length:596 Length:596
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## il1_a_value il1_b_value il1_ra_value il18_value
## Min. : 0.1751 Min. : 0.3786 Min. : 1.355 Min. : 1.501
## 1st Qu.: 2.2933 1st Qu.: 11.1629 1st Qu.: 665.718 1st Qu.: 279.288
## Median : 3.7308 Median : 12.7285 Median : 1032.425 Median : 448.818
## Mean : 5.5595 Mean : 13.6417 Mean : 1767.633 Mean : 715.676
## 3rd Qu.: 6.3253 3rd Qu.: 14.3496 3rd Qu.: 1745.067 3rd Qu.: 693.103
## Max. :62.5197 Max. :154.9024 Max. :24279.375 Max. :9421.688
## NA's :96 NA's :96 NA's :96 NA's :96
## il18_bp_value il18_bp_ratio il18_free il36_b_value
## Min. : 82.47 Min. : 3.765 Min. : 37.62 Min. : 0.0258
## 1st Qu.: 2976.00 1st Qu.: 31.140 1st Qu.: 193.99 1st Qu.: 2.3362
## Median : 3543.00 Median : 50.540 Median : 317.73 Median : 3.6714
## Mean : 3708.59 Mean : 87.717 Mean : 486.13 Mean : 5.5442
## 3rd Qu.: 4168.00 3rd Qu.: 81.141 3rd Qu.: 476.33 3rd Qu.: 5.5809
## Max. :30834.43 Max. :2967.066 Max. :6155.32 Max. :90.0555
## NA's :19 NA's :115 NA's :115 NA's :96
## creatinine egfr
## Min. : 53.0 Min. :0.030
## 1st Qu.: 114.5 1st Qu.:0.160
## Median : 169.7 Median :0.580
## Mean : 316.4 Mean :0.624
## 3rd Qu.: 480.6 3rd Qu.:0.930
## Max. :1778.9 Max. :1.880
## 2 Summary statistics
Summary table for all relevant variables
2.1 Healthy included
2.1.1 Continuous variables with median and quartiles
Open code
sumtab1 <- run(
patient_table %>% select(-id, -rejection_afterTX) %>%
tbl_summary( by='group',
type = list(hemodialysis_years ~ 'continuous',
N_mismatch ~ 'continuous')
) %>%
modify_caption('Subjects characteristics according to group (healthy vs. with acute rejection vs. no acute rejection') %>%
add_p(),
path = 'gitignore/run/sumtab1', reuse=TRUE)
sumtab1| Characteristic | acute_rejection, N = 441 | healthy, N = 481 | no_rejection, N = 941 | p-value2 |
|---|---|---|---|---|
| receiver_sex | 0.075 | |||
| female | 16 (36%) | 26 (54%) | 33 (35%) | |
| male | 28 (64%) | 22 (46%) | 61 (65%) | |
| receiver_age | 54 (44, 62) | NA (NA, NA) | 58 (46, 66) | 0.14 |
| Unknown | 0 | 48 | 0 | |
| donor_sex | >0.9 | |||
| female | 18 (41%) | 0 (NA%) | 37 (39%) | |
| male | 26 (59%) | 0 (NA%) | 57 (61%) | |
| Unknown | 0 | 48 | 0 | |
| donor_age | 51 (42, 58) | NA (NA, NA) | 57 (46, 66) | 0.066 |
| Unknown | 0 | 48 | 0 | |
| N_mismatch | 3 (2, 4) | NA (NA, NA) | 3 (3, 4) | >0.9 |
| Unknown | 0 | 48 | 0 | |
| dsa | 0.002 | |||
| neg | 27 (61%) | 0 (NA%) | 81 (86%) | |
| pos | 17 (39%) | 0 (NA%) | 13 (14%) | |
| Unknown | 0 | 48 | 0 | |
| anti_hla | 0.032 | |||
| N/A | 0 (0%) | 0 (NA%) | 1 (1.1%) | |
| neg | 27 (61%) | 0 (NA%) | 75 (80%) | |
| pos | 17 (39%) | 0 (NA%) | 18 (19%) | |
| Unknown | 0 | 48 | 0 | |
| PRA_max | 10 (3, 29) | NA (NA, NA) | 10 (2, 30) | 0.9 |
| Unknown | 0 | 48 | 0 | |
| PRA_actual | 2 (0, 6) | NA (NA, NA) | 2 (0, 20) | 0.3 |
| Unknown | 0 | 48 | 0 | |
| hemodialysis_years | 2.30 (1.40, 3.90) | NA (NA, NA) | 2.30 (1.30, 4.00) | >0.9 |
| Unknown | 0 | 48 | 1 | |
| TX_order | <0.001 | |||
| 1 | 32 (73%) | 0 (NA%) | 93 (99%) | |
| 2 | 11 (25%) | 0 (NA%) | 1 (1.1%) | |
| 4 | 1 (2.3%) | 0 (NA%) | 0 (0%) | |
| Unknown | 0 | 48 | 0 | |
| ebv | >0.9 | |||
| neg | 0 (0%) | 0 (NA%) | 2 (2.8%) | |
| pos | 35 (100%) | 0 (NA%) | 69 (97%) | |
| Unknown | 9 | 48 | 23 | |
| cmv | 0.2 | |||
| N/A | 0 (0%) | 0 (NA%) | 1 (1.1%) | |
| neg | 10 (23%) | 0 (NA%) | 11 (12%) | |
| pos | 34 (77%) | 0 (NA%) | 82 (87%) | |
| Unknown | 0 | 48 | 0 | |
| CIT_hours | 15 (12, 18) | NA (NA, NA) | 14 (12, 16) | 0.093 |
| Unknown | 0 | 48 | 0 | |
| MT_minutes | 22 (18, 27) | NA (NA, NA) | 25 (20, 31) | 0.051 |
| Unknown | 0 | 48 | 0 | |
| induction_therapy | 0.004 | |||
| ATG | 14 (32%) | 0 (NA%) | 57 (61%) | |
| ATG,PE,IVIG | 10 (23%) | 0 (NA%) | 8 (8.5%) | |
| ATG+ Infliximab | 1 (2.3%) | 0 (NA%) | 0 (0%) | |
| ATG+Infliximab | 3 (6.8%) | 0 (NA%) | 2 (2.1%) | |
| Simulect | 16 (36%) | 0 (NA%) | 27 (29%) | |
| Unknown | 0 | 48 | 0 | |
| tacrolimus | 44 (100%) | 0 (NA%) | 91 (97%) | 0.6 |
| Unknown | 0 | 48 | 0 | |
| MMF | 39 (89%) | 0 (NA%) | 89 (95%) | 0.3 |
| Unknown | 0 | 48 | 0 | |
| mTOR | 0 (0%) | 0 (NA%) | 3 (3.2%) | 0.6 |
| Unknown | 0 | 48 | 0 | |
| egfr_mean | 0.49 (0.35, 0.65) | 1.48 (1.15, 1.63) | 0.55 (0.41, 0.72) | <0.001 |
| creatinine_mean | 318 (246, 385) | 85 (71, 97) | 307 (235, 412) | <0.001 |
| il1_a_mean | 3.6 (2.9, 4.7) | 0.2 (0.2, 0.9) | 5.4 (3.5, 10.2) | <0.001 |
| il1_b_mean | 13.4 (12.5, 14.5) | 3.8 (2.9, 4.4) | 13.7 (12.2, 16.3) | <0.001 |
| il1_ra_mean | 1,291 (880, 2,044) | 440 (321, 577) | 1,418 (1,060, 2,738) | <0.001 |
| il18_mean | 626 (389, 907) | 196 (146, 280) | 554 (371, 1,010) | <0.001 |
| il18_bp_mean | 3,389 (2,999, 3,997) | 2,813 (2,465, 3,074) | 3,649 (3,346, 4,194) | <0.001 |
| Unknown | 0 | 17 | 0 | |
| il18_free_mean | 418 (268, 608) | 145 (121, 194) | 359 (236, 647) | <0.001 |
| Unknown | 0 | 17 | 0 | |
| il36_b_mean | 3.5 (2.5, 4.2) | 1.8 (1.3, 2.5) | 5.1 (3.8, 7.2) | <0.001 |
| 1 n (%); Median (IQR) | ||||
| 2 Pearson’s Chi-squared test; Kruskal-Wallis rank sum test; Fisher’s exact test | ||||
2.1.2 Creatinine and EGFR median and range
Open code
sumtab1b <- run(
patient_table %>% select(-id, -rejection_afterTX) %>%
tbl_summary( by='group',
type = list(hemodialysis_years ~ 'continuous',
N_mismatch ~ 'continuous',
all_continuous() ~ "continuous2"),
statistic = list(all_continuous() ~ c(
"{median} ({min}, {max})"))) %>%
modify_caption('Subjects characteristics according to group (healthy vs. with acute rejection vs. no acute rejection') %>%
add_p(),
path = 'gitignore/run/sumtab1b', reuse=TRUE)
sumtab1b| Characteristic | acute_rejection, N = 441 | healthy, N = 481 | no_rejection, N = 941 | p-value2 |
|---|---|---|---|---|
| receiver_sex | 0.075 | |||
| female | 16 (36%) | 26 (54%) | 33 (35%) | |
| male | 28 (64%) | 22 (46%) | 61 (65%) | |
| receiver_age | 0.14 | |||
| Median (Range) | 54 (23, 79) | NA (Inf, -Inf) | 58 (22, 80) | |
| Unknown | 0 | 48 | 0 | |
| donor_sex | >0.9 | |||
| female | 18 (41%) | 0 (NA%) | 37 (39%) | |
| male | 26 (59%) | 0 (NA%) | 57 (61%) | |
| Unknown | 0 | 48 | 0 | |
| donor_age | 0.066 | |||
| Median (Range) | 51 (21, 75) | NA (Inf, -Inf) | 57 (1, 81) | |
| Unknown | 0 | 48 | 0 | |
| N_mismatch | 3 (0, 6) | NA (Inf, -Inf) | 3 (1, 6) | >0.9 |
| Unknown | 0 | 48 | 0 | |
| dsa | 0.002 | |||
| neg | 27 (61%) | 0 (NA%) | 81 (86%) | |
| pos | 17 (39%) | 0 (NA%) | 13 (14%) | |
| Unknown | 0 | 48 | 0 | |
| anti_hla | 0.032 | |||
| N/A | 0 (0%) | 0 (NA%) | 1 (1.1%) | |
| neg | 27 (61%) | 0 (NA%) | 75 (80%) | |
| pos | 17 (39%) | 0 (NA%) | 18 (19%) | |
| Unknown | 0 | 48 | 0 | |
| PRA_max | 0.9 | |||
| Median (Range) | 10 (0, 92) | NA (Inf, -Inf) | 10 (0, 98) | |
| Unknown | 0 | 48 | 0 | |
| PRA_actual | 0.3 | |||
| Median (Range) | 2 (0, 92) | NA (Inf, -Inf) | 2 (0, 78) | |
| Unknown | 0 | 48 | 0 | |
| hemodialysis_years | >0.9 | |||
| Median (Range) | 2.30 (0.00, 10.90) | NA (Inf, -Inf) | 2.30 (0.00, 11.90) | |
| Unknown | 0 | 48 | 1 | |
| TX_order | <0.001 | |||
| 1 | 32 (73%) | 0 (NA%) | 93 (99%) | |
| 2 | 11 (25%) | 0 (NA%) | 1 (1.1%) | |
| 4 | 1 (2.3%) | 0 (NA%) | 0 (0%) | |
| Unknown | 0 | 48 | 0 | |
| ebv | >0.9 | |||
| neg | 0 (0%) | 0 (NA%) | 2 (2.8%) | |
| pos | 35 (100%) | 0 (NA%) | 69 (97%) | |
| Unknown | 9 | 48 | 23 | |
| cmv | 0.2 | |||
| N/A | 0 (0%) | 0 (NA%) | 1 (1.1%) | |
| neg | 10 (23%) | 0 (NA%) | 11 (12%) | |
| pos | 34 (77%) | 0 (NA%) | 82 (87%) | |
| Unknown | 0 | 48 | 0 | |
| CIT_hours | 0.093 | |||
| Median (Range) | 15 (0, 21) | NA (Inf, -Inf) | 14 (0, 24) | |
| Unknown | 0 | 48 | 0 | |
| MT_minutes | 0.051 | |||
| Median (Range) | 22 (15, 49) | NA (Inf, -Inf) | 25 (7, 57) | |
| Unknown | 0 | 48 | 0 | |
| induction_therapy | 0.004 | |||
| ATG | 14 (32%) | 0 (NA%) | 57 (61%) | |
| ATG,PE,IVIG | 10 (23%) | 0 (NA%) | 8 (8.5%) | |
| ATG+ Infliximab | 1 (2.3%) | 0 (NA%) | 0 (0%) | |
| ATG+Infliximab | 3 (6.8%) | 0 (NA%) | 2 (2.1%) | |
| Simulect | 16 (36%) | 0 (NA%) | 27 (29%) | |
| Unknown | 0 | 48 | 0 | |
| tacrolimus | 44 (100%) | 0 (NA%) | 91 (97%) | 0.6 |
| Unknown | 0 | 48 | 0 | |
| MMF | 39 (89%) | 0 (NA%) | 89 (95%) | 0.3 |
| Unknown | 0 | 48 | 0 | |
| mTOR | 0 (0%) | 0 (NA%) | 3 (3.2%) | 0.6 |
| Unknown | 0 | 48 | 0 | |
| egfr_mean | <0.001 | |||
| Median (Range) | 0.49 (0.14, 1.21) | 1.48 (0.82, 1.88) | 0.55 (0.15, 1.23) | |
| creatinine_mean | <0.001 | |||
| Median (Range) | 318 (92, 1,173) | 85 (53, 136) | 307 (117, 813) | |
| il1_a_mean | <0.001 | |||
| Median (Range) | 3.6 (1.2, 25.7) | 0.2 (0.2, 46.7) | 5.4 (0.2, 29.8) | |
| il1_b_mean | <0.001 | |||
| Median (Range) | 13.4 (10.8, 19.7) | 3.8 (0.4, 45.4) | 13.7 (10.0, 48.9) | |
| il1_ra_mean | <0.001 | |||
| Median (Range) | 1,291 (504, 6,224) | 440 (1, 2,636) | 1,418 (448, 12,548) | |
| il18_mean | <0.001 | |||
| Median (Range) | 626 (185, 2,025) | 196 (2, 499) | 554 (127, 5,016) | |
| il18_bp_mean | <0.001 | |||
| Median (Range) | 3,389 (2,399, 6,127) | 2,813 (1,946, 4,287) | 3,649 (2,160, 11,804) | |
| Unknown | 0 | 17 | 0 | |
| il18_free_mean | <0.001 | |||
| Median (Range) | 418 (138, 1,486) | 145 (78, 354) | 359 (79, 3,280) | |
| Unknown | 0 | 17 | 0 | |
| il36_b_mean | <0.001 | |||
| Median (Range) | 3.5 (0.4, 53.5) | 1.8 (0.0, 21.1) | 5.1 (0.2, 26.7) | |
| 1 n (%); Median (Range) | ||||
| 2 Pearson’s Chi-squared test; Kruskal-Wallis rank sum test; Fisher’s exact test | ||||
2.2 TX patients only
2.2.1 Meidian + IQR
Open code
sumtab2 <- run(
patient_table %>% select(-id, -rejection_afterTX) %>%
filter(group != 'healthy') %>%
mutate(group = factor(group)) %>%
tbl_summary( by='group',
type = list(hemodialysis_years ~ 'continuous',
N_mismatch ~ 'continuous')
) %>%
modify_caption('Patient characteristics according to developed acute rejection') %>%
add_p(),
path = 'gitignore/run/sumtab2', reuse=TRUE)
sumtab2| Characteristic | acute_rejection, N = 441 | no_rejection, N = 941 | p-value2 |
|---|---|---|---|
| receiver_sex | 0.9 | ||
| female | 16 (36%) | 33 (35%) | |
| male | 28 (64%) | 61 (65%) | |
| receiver_age | 54 (44, 62) | 58 (46, 66) | 0.14 |
| donor_sex | 0.9 | ||
| female | 18 (41%) | 37 (39%) | |
| male | 26 (59%) | 57 (61%) | |
| donor_age | 51 (42, 58) | 57 (46, 66) | 0.066 |
| N_mismatch | 3 (2, 4) | 3 (3, 4) | >0.9 |
| dsa | <0.001 | ||
| neg | 27 (61%) | 81 (86%) | |
| pos | 17 (39%) | 13 (14%) | |
| anti_hla | 0.032 | ||
| N/A | 0 (0%) | 1 (1.1%) | |
| neg | 27 (61%) | 75 (80%) | |
| pos | 17 (39%) | 18 (19%) | |
| PRA_max | 10 (3, 29) | 10 (2, 30) | 0.9 |
| PRA_actual | 2 (0, 6) | 2 (0, 20) | 0.3 |
| hemodialysis_years | 2.30 (1.40, 3.90) | 2.30 (1.30, 4.00) | >0.9 |
| Unknown | 0 | 1 | |
| TX_order | <0.001 | ||
| 1 | 32 (73%) | 93 (99%) | |
| 2 | 11 (25%) | 1 (1.1%) | |
| 4 | 1 (2.3%) | 0 (0%) | |
| ebv | >0.9 | ||
| neg | 0 (0%) | 2 (2.8%) | |
| pos | 35 (100%) | 69 (97%) | |
| Unknown | 9 | 23 | |
| cmv | 0.2 | ||
| N/A | 0 (0%) | 1 (1.1%) | |
| neg | 10 (23%) | 11 (12%) | |
| pos | 34 (77%) | 82 (87%) | |
| CIT_hours | 15 (12, 18) | 14 (12, 16) | 0.094 |
| MT_minutes | 22 (18, 27) | 25 (20, 31) | 0.051 |
| induction_therapy | 0.004 | ||
| ATG | 14 (32%) | 57 (61%) | |
| ATG,PE,IVIG | 10 (23%) | 8 (8.5%) | |
| ATG+ Infliximab | 1 (2.3%) | 0 (0%) | |
| ATG+Infliximab | 3 (6.8%) | 2 (2.1%) | |
| Simulect | 16 (36%) | 27 (29%) | |
| tacrolimus | 44 (100%) | 91 (97%) | 0.6 |
| MMF | 39 (89%) | 89 (95%) | 0.3 |
| mTOR | 0 (0%) | 3 (3.2%) | 0.6 |
| egfr_mean | 0.49 (0.35, 0.65) | 0.55 (0.41, 0.72) | 0.2 |
| creatinine_mean | 318 (246, 385) | 307 (235, 412) | 0.9 |
| il1_a_mean | 3.6 (2.9, 4.7) | 5.4 (3.5, 10.2) | 0.001 |
| il1_b_mean | 13.4 (12.5, 14.5) | 13.7 (12.2, 16.3) | 0.13 |
| il1_ra_mean | 1,291 (880, 2,044) | 1,418 (1,060, 2,738) | 0.10 |
| il18_mean | 626 (389, 907) | 554 (371, 1,010) | >0.9 |
| il18_bp_mean | 3,389 (2,999, 3,997) | 3,649 (3,346, 4,194) | 0.2 |
| il18_free_mean | 418 (268, 608) | 359 (236, 647) | 0.7 |
| il36_b_mean | 3.5 (2.5, 4.2) | 5.1 (3.8, 7.2) | <0.001 |
| 1 n (%); Median (IQR) | |||
| 2 Pearson’s Chi-squared test; Wilcoxon rank sum test; Fisher’s exact test | |||
2.2.2 Median + range
Open code
sumtab2b <- run(
patient_table %>% select(-id, -rejection_afterTX) %>%
filter(group != 'healthy') %>%
mutate(group = factor(group)) %>%
tbl_summary( by='group',
type = list(hemodialysis_years ~ 'continuous',
N_mismatch ~ 'continuous',
all_continuous() ~ "continuous2"),
statistic = list(all_continuous() ~ c(
"{median} ({min}, {max})"))) %>%
modify_caption('Patient characteristics according to developed acute rejection') %>%
add_p(),
path = 'gitignore/run/sumtab2b', reuse=TRUE)
sumtab2b| Characteristic | acute_rejection, N = 441 | no_rejection, N = 941 | p-value2 |
|---|---|---|---|
| receiver_sex | 0.9 | ||
| female | 16 (36%) | 33 (35%) | |
| male | 28 (64%) | 61 (65%) | |
| receiver_age | 0.14 | ||
| Median (Range) | 54 (23, 79) | 58 (22, 80) | |
| donor_sex | 0.9 | ||
| female | 18 (41%) | 37 (39%) | |
| male | 26 (59%) | 57 (61%) | |
| donor_age | 0.066 | ||
| Median (Range) | 51 (21, 75) | 57 (1, 81) | |
| N_mismatch | 3 (0, 6) | 3 (1, 6) | >0.9 |
| dsa | <0.001 | ||
| neg | 27 (61%) | 81 (86%) | |
| pos | 17 (39%) | 13 (14%) | |
| anti_hla | 0.032 | ||
| N/A | 0 (0%) | 1 (1.1%) | |
| neg | 27 (61%) | 75 (80%) | |
| pos | 17 (39%) | 18 (19%) | |
| PRA_max | 0.9 | ||
| Median (Range) | 10 (0, 92) | 10 (0, 98) | |
| PRA_actual | 0.3 | ||
| Median (Range) | 2 (0, 92) | 2 (0, 78) | |
| hemodialysis_years | >0.9 | ||
| Median (Range) | 2.30 (0.00, 10.90) | 2.30 (0.00, 11.90) | |
| Unknown | 0 | 1 | |
| TX_order | <0.001 | ||
| 1 | 32 (73%) | 93 (99%) | |
| 2 | 11 (25%) | 1 (1.1%) | |
| 4 | 1 (2.3%) | 0 (0%) | |
| ebv | >0.9 | ||
| neg | 0 (0%) | 2 (2.8%) | |
| pos | 35 (100%) | 69 (97%) | |
| Unknown | 9 | 23 | |
| cmv | 0.2 | ||
| N/A | 0 (0%) | 1 (1.1%) | |
| neg | 10 (23%) | 11 (12%) | |
| pos | 34 (77%) | 82 (87%) | |
| CIT_hours | 0.094 | ||
| Median (Range) | 15 (0, 21) | 14 (0, 24) | |
| MT_minutes | 0.051 | ||
| Median (Range) | 22 (15, 49) | 25 (7, 57) | |
| induction_therapy | 0.004 | ||
| ATG | 14 (32%) | 57 (61%) | |
| ATG,PE,IVIG | 10 (23%) | 8 (8.5%) | |
| ATG+ Infliximab | 1 (2.3%) | 0 (0%) | |
| ATG+Infliximab | 3 (6.8%) | 2 (2.1%) | |
| Simulect | 16 (36%) | 27 (29%) | |
| tacrolimus | 44 (100%) | 91 (97%) | 0.6 |
| MMF | 39 (89%) | 89 (95%) | 0.3 |
| mTOR | 0 (0%) | 3 (3.2%) | 0.6 |
| egfr_mean | 0.2 | ||
| Median (Range) | 0.49 (0.14, 1.21) | 0.55 (0.15, 1.23) | |
| creatinine_mean | 0.9 | ||
| Median (Range) | 318 (92, 1,173) | 307 (117, 813) | |
| il1_a_mean | 0.001 | ||
| Median (Range) | 3.6 (1.2, 25.7) | 5.4 (0.2, 29.8) | |
| il1_b_mean | 0.13 | ||
| Median (Range) | 13.4 (10.8, 19.7) | 13.7 (10.0, 48.9) | |
| il1_ra_mean | 0.10 | ||
| Median (Range) | 1,291 (504, 6,224) | 1,418 (448, 12,548) | |
| il18_mean | >0.9 | ||
| Median (Range) | 626 (185, 2,025) | 554 (127, 5,016) | |
| il18_bp_mean | 0.2 | ||
| Median (Range) | 3,389 (2,399, 6,127) | 3,649 (2,160, 11,804) | |
| il18_free_mean | 0.7 | ||
| Median (Range) | 418 (138, 1,486) | 359 (79, 3,280) | |
| il36_b_mean | <0.001 | ||
| Median (Range) | 3.5 (0.4, 53.5) | 5.1 (0.2, 26.7) | |
| 1 n (%); Median (Range) | |||
| 2 Pearson’s Chi-squared test; Wilcoxon rank sum test; Fisher’s exact test | |||
2.3 Summary table for continuous variables
Open code
sumtab <- patient_table %>%
select(
receiver_age, donor_age,
N_mismatch, PRA_max, PRA_actual, CIT_hours, MT_minutes,
hemodialysis_years, group, il1_a_mean, il1_b_mean, il1_ra_mean,
il18_mean, il18_bp_mean, il18_free_mean, il36_b_mean) %>%
group_by(group) %>%
summarize(across(where(is.numeric),
list(median = ~median(., na.rm = TRUE),
mean = ~mean(., na.rm = TRUE),
IQR = ~IQR(., na.rm = TRUE),
Q25 = ~quantile(., 0.25, na.rm = TRUE),
Q75 = ~quantile(., 0.75, na.rm = TRUE),
Q95 = ~quantile(., 0.95, na.rm = TRUE),
sd = ~sd(., na.rm = TRUE)),
.names = "{.col}_{.fn}"))
kableExtra::kable(t(sumtab)) | group | acute_rejection | healthy | no_rejection |
| receiver_age_median | 54 | NA | 58 |
| receiver_age_mean | 52.15909 | NA | 55.85106 |
| receiver_age_IQR | 18.25 | NA | 19.75 |
| receiver_age_Q25 | 44.00 | NA | 46.25 |
| receiver_age_Q75 | 62.25 | NA | 66.00 |
| receiver_age_Q95 | 73.4 | NA | 72.7 |
| receiver_age_sd | 13.95498 | NA | 13.41076 |
| donor_age_median | 51.0 | NA | 56.5 |
| donor_age_mean | 49.90909 | NA | 54.15957 |
| donor_age_IQR | 16.5 | NA | 20.0 |
| donor_age_Q25 | 41.75 | NA | 46.00 |
| donor_age_Q75 | 58.25 | NA | 66.00 |
| donor_age_Q95 | 73.95 | NA | 74.35 |
| donor_age_sd | 14.00468 | NA | 15.41630 |
| N_mismatch_median | 3 | NA | 3 |
| N_mismatch_mean | 3.250000 | NA | 3.329787 |
| N_mismatch_IQR | 2 | NA | 1 |
| N_mismatch_Q25 | 2 | NA | 3 |
| N_mismatch_Q75 | 4 | NA | 4 |
| N_mismatch_Q95 | 5 | NA | 5 |
| N_mismatch_sd | 1.331637 | NA | 1.212731 |
| PRA_max_median | 10 | NA | 10 |
| PRA_max_mean | 19.40909 | NA | 18.93617 |
| PRA_max_IQR | 26.25 | NA | 27.25 |
| PRA_max_Q25 | 2.75 | NA | 2.25 |
| PRA_max_Q75 | 29.0 | NA | 29.5 |
| PRA_max_Q95 | 73.9 | NA | 52.7 |
| PRA_max_sd | 23.26322 | NA | 19.97407 |
| PRA_actual_median | 2 | NA | 2 |
| PRA_actual_mean | 10.00000 | NA | 12.35106 |
| PRA_actual_IQR | 6.0 | NA | 19.5 |
| PRA_actual_Q25 | 0 | NA | 0 |
| PRA_actual_Q75 | 6.0 | NA | 19.5 |
| PRA_actual_Q95 | 69.7 | NA | 52.7 |
| PRA_actual_sd | 21.58703 | NA | 18.72191 |
| CIT_hours_median | 15 | NA | 14 |
| CIT_hours_mean | 14.31818 | NA | 13.40426 |
| CIT_hours_IQR | 6 | NA | 4 |
| CIT_hours_Q25 | 12 | NA | 12 |
| CIT_hours_Q75 | 18 | NA | 16 |
| CIT_hours_Q95 | 21.00 | NA | 20.35 |
| CIT_hours_sd | 5.065950 | NA | 4.489699 |
| MT_minutes_median | 21.5 | NA | 25.0 |
| MT_minutes_mean | 23.90909 | NA | 26.05319 |
| MT_minutes_IQR | 8.50 | NA | 10.75 |
| MT_minutes_Q25 | 18.00 | NA | 20.25 |
| MT_minutes_Q75 | 26.5 | NA | 31.0 |
| MT_minutes_Q95 | 42.85 | NA | 40.35 |
| MT_minutes_sd | 8.454580 | NA | 8.773576 |
| hemodialysis_years_median | 2.3 | NA | 2.3 |
| hemodialysis_years_mean | 2.972727 | NA | 3.082796 |
| hemodialysis_years_IQR | 2.5 | NA | 2.7 |
| hemodialysis_years_Q25 | 1.4 | NA | 1.3 |
| hemodialysis_years_Q75 | 3.9 | NA | 4.0 |
| hemodialysis_years_Q95 | 7.055 | NA | 8.600 |
| hemodialysis_years_sd | 2.271396 | NA | 2.491273 |
| il1_a_mean_median | 3.6138431 | 0.1751254 | 5.4099081 |
| il1_a_mean_mean | 4.519618 | 1.790396 | 6.880929 |
| il1_a_mean_IQR | 1.8399964 | 0.7684427 | 6.6405988 |
| il1_a_mean_Q25 | 2.8678507 | 0.1751254 | 3.5186279 |
| il1_a_mean_Q75 | 4.7078471 | 0.9435681 | 10.1592267 |
| il1_a_mean_Q95 | 7.953788 | 4.148860 | 16.998875 |
| il1_a_mean_sd | 3.702535 | 6.758296 | 5.079430 |
| il1_b_mean_median | 13.379882 | 3.800578 | 13.726654 |
| il1_b_mean_mean | 13.614621 | 4.568534 | 15.435899 |
| il1_b_mean_IQR | 2.016068 | 1.490545 | 4.087478 |
| il1_b_mean_Q25 | 12.456512 | 2.865737 | 12.211393 |
| il1_b_mean_Q75 | 14.472580 | 4.356282 | 16.298871 |
| il1_b_mean_Q95 | 16.980015 | 6.139183 | 24.715130 |
| il1_b_mean_sd | 1.876318 | 6.136904 | 5.552799 |
| il1_ra_mean_median | 1291.0082 | 439.8988 | 1417.6213 |
| il1_ra_mean_mean | 1607.137 | 531.280 | 2191.771 |
| il1_ra_mean_IQR | 1163.9840 | 255.8475 | 1677.9097 |
| il1_ra_mean_Q25 | 879.6144 | 320.7617 | 1059.8544 |
| il1_ra_mean_Q75 | 2043.5983 | 576.6092 | 2737.7641 |
| il1_ra_mean_Q95 | 3206.0827 | 895.6011 | 5748.7204 |
| il1_ra_mean_sd | 1054.4684 | 464.7765 | 1883.0248 |
| il18_mean_median | 626.2038 | 196.2464 | 553.9956 |
| il18_mean_mean | 706.7674 | 220.7274 | 849.2618 |
| il18_mean_IQR | 518.0835 | 133.1681 | 639.2590 |
| il18_mean_Q25 | 388.6040 | 146.4606 | 370.9122 |
| il18_mean_Q75 | 906.6875 | 279.6288 | 1010.1712 |
| il18_mean_Q95 | 1546.9192 | 403.6279 | 2401.4965 |
| il18_mean_sd | 413.15414 | 99.47696 | 778.91956 |
| il18_bp_mean_median | 3389.167 | 2813.000 | 3649.250 |
| il18_bp_mean_mean | 3666.610 | 2854.484 | 3791.695 |
| il18_bp_mean_IQR | 998.5208 | 609.0000 | 847.5291 |
| il18_bp_mean_Q25 | 2998.875 | 2465.000 | 3346.188 |
| il18_bp_mean_Q75 | 3997.396 | 3074.000 | 4193.717 |
| il18_bp_mean_Q95 | 5281.432 | 3746.500 | 4749.825 |
| il18_bp_mean_sd | 889.4910 | 514.8316 | 1053.8108 |
| il18_free_mean_median | 417.7738 | 144.8761 | 358.7065 |
| il18_free_mean_mean | 478.2362 | 164.6453 | 541.8925 |
| il18_free_mean_IQR | 339.20872 | 72.47453 | 411.11565 |
| il18_free_mean_Q25 | 268.4762 | 121.4914 | 235.7412 |
| il18_free_mean_Q75 | 607.6849 | 193.9659 | 646.8569 |
| il18_free_mean_Q95 | 1059.7969 | 306.6846 | 1639.1865 |
| il18_free_mean_sd | 286.58937 | 69.54324 | 499.73260 |
| il36_b_mean_median | 3.516403 | 1.823203 | 5.079123 |
| il36_b_mean_mean | 5.616041 | 2.465567 | 6.180597 |
| il36_b_mean_IQR | 1.639928 | 1.250801 | 3.346720 |
| il36_b_mean_Q25 | 2.543047 | 1.279165 | 3.806194 |
| il36_b_mean_Q75 | 4.182975 | 2.529966 | 7.152914 |
| il36_b_mean_Q95 | 19.429293 | 3.638789 | 12.446111 |
| il36_b_mean_sd | 8.701474 | 3.398531 | 4.137029 |
3 Patients with exceptional values of IL18 forms
Open code
data_long %>% arrange(il18_value) %>% slice_head(n=10)
## id time_point group id_obs il1_a_value il1_b_value il1_ra_value
## 371 h13 000 healthy h13.000 2.3593983 4.828128 1.355488
## 420 13 007 acute_rejection 13.007 2.4200000 9.185659 660.616206
## 566 161 000 acute_rejection 161.000 3.9600000 13.434223 385.840570
## 207 149 007 no_rejection 149.007 2.5388224 10.038359 371.936954
## 567 161 007 acute_rejection 161.007 7.8800000 10.662728 606.625574
## 450 33 007 acute_rejection 33.007 2.5700000 9.874221 989.400140
## 229 164 007 no_rejection 164.007 5.0273935 10.038359 515.907780
## 473 50 007 acute_rejection 50.007 2.8700000 9.874221 1827.179202
## 359 h1 000 healthy h1.000 0.9435681 4.484811 149.989122
## 377 h19 000 healthy h19.000 0.1751254 4.142265 398.060132
## il18_value il18_bp_value il18_bp_ratio il18_free il36_b_value creatinine
## 371 1.50082 NA NA NA 1.3232372 72.3
## 420 65.98134 2659.000 9.925738 48.87983 3.0820967 148.0
## 566 79.35453 8429.987 3.765345 37.62289 5.0502303 549.7
## 207 83.78820 4430.000 7.565526 52.93353 4.4161526 979.6
## 567 90.06153 4042.000 8.912571 58.79296 4.2606163 477.2
## 450 91.15212 2984.000 12.218783 65.45315 3.3967893 147.0
## 229 93.21592 2716.000 13.728413 68.67400 3.9320018 127.6
## 473 93.45905 4168.000 8.969198 60.35764 3.2579483 804.6
## 359 97.75158 1946.000 20.092822 77.82443 0.2677636 102.8
## 377 99.82022 2187.000 18.257014 77.51443 3.1490548 65.9
## egfr
## 371 1.87
## 420 0.51
## 566 0.10
## 207 0.08
## 567 0.12
## 450 0.83
## 229 0.66
## 473 0.09
## 359 1.25
## 377 1.78
data_long %>% arrange(il18_free) %>% slice_head(n=10)
## id time_point group id_obs il1_a_value il1_b_value il1_ra_value
## 566 161 000 acute_rejection 161.000 3.960000 13.434223 385.8406
## 420 13 007 acute_rejection 13.007 2.420000 9.185659 660.6162
## 207 149 007 no_rejection 149.007 2.538822 10.038359 371.9370
## 567 161 007 acute_rejection 161.007 7.880000 10.662728 606.6256
## 473 50 007 acute_rejection 50.007 2.870000 9.874221 1827.1792
## 562 157 007 acute_rejection 157.007 2.570000 9.546168 1894.3570
## 450 33 007 acute_rejection 33.007 2.570000 9.874221 989.4001
## 229 164 007 no_rejection 164.007 5.027393 10.038359 515.9078
## 40 46 007 no_rejection 46.007 2.386611 9.480593 531.1226
## 39 46 000 no_rejection 46.000 2.872530 9.710157 798.2475
## il18_value il18_bp_value il18_bp_ratio il18_free il36_b_value creatinine
## 566 79.35453 8429.987 3.765345 37.62289 5.050230 549.7
## 420 65.98134 2659.000 9.925738 48.87983 3.082097 148.0
## 207 83.78820 4430.000 7.565526 52.93353 4.416153 979.6
## 567 90.06153 4042.000 8.912571 58.79296 4.260616 477.2
## 473 93.45905 4168.000 8.969198 60.35764 3.257948 804.6
## 562 102.99198 4800.000 8.582665 63.12412 3.618840 485.2
## 450 91.15212 2984.000 12.218783 65.45315 3.396789 147.0
## 229 93.21592 2716.000 13.728413 68.67400 3.932002 127.6
## 40 104.22117 3283.000 12.698284 72.78148 3.727193 137.1
## 39 130.24469 5907.000 8.819685 73.28494 4.461622 618.2
## egfr
## 566 0.10
## 420 0.51
## 207 0.08
## 567 0.12
## 473 0.09
## 562 0.15
## 450 0.83
## 229 0.66
## 40 0.77
## 39 0.13
data_long %>% arrange(il18_bp_value) %>% slice_head(n=10)
## id time_point group id_obs il1_a_value il1_b_value il1_ra_value
## 117 94 007 no_rejection 94.007 2.4475376 10.761404 1809.0168
## 112 91 000 no_rejection 91.000 13.0728099 15.822496 3106.3046
## 354 224 365 no_rejection 224.365 NA NA NA
## 358 225 365 no_rejection 225.365 NA NA NA
## 461 39 090 acute_rejection 39.090 4.9529855 16.631949 7491.4232
## 269 188 090 no_rejection 188.090 NA NA NA
## 359 h1 000 healthy h1.000 0.9435681 4.484811 149.9891
## 538 120 007 acute_rejection 120.007 3.7680105 14.150673 1058.5258
## 107 87 365 no_rejection 87.365 7.6610175 7.384999 1451.9446
## 249 175 090 no_rejection 175.090 NA NA NA
## il18_value il18_bp_value il18_bp_ratio il18_free il36_b_value creatinine
## 117 167.79567 82.47145 813.83637 165.99438 4.3707304 202.4
## 112 1082.97893 146.00000 2967.06557 1062.56647 8.8875903 464.0
## 354 NA 165.80000 NA NA NA 81.5
## 358 NA 229.00000 NA NA NA 156.9
## 461 185.95266 1539.00000 48.33078 154.63839 6.4724064 123.2
## 269 NA 1638.00000 NA NA NA 111.9
## 359 97.75158 1946.00000 20.09282 77.82443 0.2677636 102.8
## 538 450.27794 2041.00000 88.24653 354.95408 3.2614558 96.1
## 107 219.21293 2048.00000 42.81502 172.68017 2.4034355 120.0
## 249 NA 2090.00000 NA NA NA 207.8
## egfr
## 117 0.44
## 112 0.22
## 354 1.04
## 358 0.65
## 461 0.88
## 269 0.93
## 359 1.25
## 538 1.21
## 107 0.66
## 249 0.484 Cytokine levels changes over time and across groups
Creating a new variable, group_sep, that combines group and time_point into a single variable. Re-defining group and time_point to be factors
Open code
data_long <- data_long %>%
mutate(group_sep = factor(interaction(group, time_point)),
group = factor(group, levels =
c("healthy",
"no_rejection",
"acute_rejection")),
time_point = factor(time_point))4.1 Il1_a
4.1.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il1_a_value))
## model fit
model_il1_a <- lmer(log10(il1_a_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il1_a)Open code
## anova result od model
Anova(model_il1_a, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_a_value)
## F Df Df.res Pr(>F)
## group_sep 15.739 9 417.45 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il1_a)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_a_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 807.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5688 -0.3288 0.0750 0.5766 3.4928
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.05345 0.2312
## Residual 0.23773 0.4876
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.54459 0.08602 6.331
## group_sephealthy.000 -0.96152 0.11604 -8.286
## group_sepno_rejection.000 0.01385 0.10245 0.135
## group_sepacute_rejection.007 -0.08337 0.10815 -0.771
## group_sepno_rejection.007 -0.09297 0.10245 -0.907
## group_sepacute_rejection.090 -0.02344 0.10975 -0.214
## group_sepno_rejection.090 0.19470 0.12090 1.610
## group_sepacute_rejection.365 -0.11856 0.11488 -1.032
## group_sepno_rejection.365 0.13162 0.12090 1.089
## group_sepacute_rejection.biopsy -0.06165 0.12267 -0.503
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.741
## grp_sp_.000 -0.840 0.622
## grp_spc_.007 -0.663 0.491 0.557
## grp_spn_.007 -0.840 0.622 0.759 0.557
## grp_spc_.090 -0.656 0.486 0.551 0.520 0.551
## grp_spn_.090 -0.711 0.527 0.643 0.472 0.643 0.467
## grp_spc_.365 -0.628 0.466 0.528 0.498 0.528 0.492
## grp_spn_.365 -0.711 0.527 0.643 0.472 0.643 0.467
## grp_spct_r. -0.586 0.434 0.492 0.464 0.492 0.459
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.447
## grp_spn_.365 0.583 0.447
## grp_spct_r. 0.417 0.435 0.4174.1.2 Pairwise comparison
4.1.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.1.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il1_a_value, g2$il1_a_value, paired=FALSE)$p.value
}4.1.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il1_a_value) %>%
pivot_wider(names_from = group_sep, values_from = il1_a_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),] %>% data.frame()
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.1.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 6.973501e-11 black 2.928870e-10
## 2 healthy.000 no_rejection.007 5.227359e-11 black 2.744363e-10
## 3 healthy.000 no_rejection.090 1.475037e-13 black 3.097579e-12
## 4 healthy.000 no_rejection.365 7.054097e-13 black 7.406802e-12
## 5 healthy.000 acute_rejection.000 5.467856e-10 black 1.913750e-09
## 6 healthy.000 acute_rejection.007 2.952645e-09 black 7.750693e-09
## 7 healthy.000 acute_rejection.090 3.797214e-11 black 2.658050e-10
## 8 healthy.000 acute_rejection.365 2.847456e-09 black 7.750693e-09
## 9 healthy.000 acute_rejection.biopsy 4.447710e-09 black 1.037799e-08
## 10 no_rejection.000 acute_rejection.000 3.608654e-01 black 4.300071e-01
## 11 no_rejection.007 acute_rejection.007 3.455284e-01 black 4.300071e-01
## 12 no_rejection.090 acute_rejection.090 6.924033e-06 black 1.321861e-05
## 13 no_rejection.365 acute_rejection.365 2.968675e-06 black 6.234218e-06
## 16 no_rejection.090 acute_rejection.biopsy 1.026038e-04 black 1.795567e-04
## 17 no_rejection.365 acute_rejection.biopsy 7.185841e-04 black 1.160790e-03
## 18 no_rejection.000 no_rejection.007 7.523005e-03 blue3 1.128451e-02
## 21 no_rejection.007 no_rejection.090 6.940287e-01 blue3 7.670843e-01
## 23 no_rejection.090 no_rejection.365 3.685775e-01 blue3 4.300071e-01
## 24 acute_rejection.000 acute_rejection.007 8.076073e-01 red4 8.076073e-01
## 27 acute_rejection.007 acute_rejection.090 7.446044e-01 red4 7.818346e-01
## 29 acute_rejection.090 acute_rejection.365 1.794364e-01 red4 2.512110e-01
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 6.973501e-11 2.928870e-10
## 2 healthy vs. no rejection D_7 5.227359e-11 2.744363e-10
## 3 healthy vs. no rejection D_90 1.475037e-13 3.097579e-12
## 4 healthy vs. no rejection D_365 7.054097e-13 7.406802e-12
## 5 healthy vs. acute rejection D_0 5.467856e-10 1.913750e-09
## 6 healthy vs. acute rejection D_7 2.952645e-09 7.750693e-09
## 7 healthy vs. acute rejection D_90 3.797214e-11 2.658050e-10
## 8 healthy vs. acute rejection D_365 2.847456e-09 7.750693e-09
## 9 healthy vs. acute rejection D_biopsy 4.447710e-09 1.037799e-08
## 10 no rejection D_90 vs. acute rejection D_90 6.924033e-06 1.321861e-05
## 11 no rejection D_365 vs. acute rejection D_365 2.968675e-06 6.234218e-06
## 12 no rejection D_90 vs. acute rejection D_biopsy 1.026038e-04 1.795567e-04
## 13 no rejection D_365 vs. acute rejection D_biopsy 7.185841e-04 1.160790e-03
## 14 no rejection D_0 vs. no rejection D_7 7.523005e-03 1.128451e-02
## star
## 1 ***
## 2 ***
## 3 ***
## 4 ***
## 5 ***
## 6 ***
## 7 ***
## 8 ***
## 9 ***
## 10 ***
## 11 ***
## 12 ***
## 13 ***
## 14 **
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.1.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il1_a_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il1_a_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = expression("IL-1" * alpha * " (pg/ml)")) +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 30)) +
annotate("text", x = 6, y = 5, label = "#", size = 7)
pair_rest$y <- c(12, 11, 16, 13,30)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il1_a <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+0.5,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il1_aOpen code
plotac <- 'plot_il1_a'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.2 Il1_b
4.2.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il1_b_value))
## model fit
model_il1_b <- lmer(log10(il1_b_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il1_b)Open code
## anova result od model
Anova(model_il1_b, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_b_value)
## F Df Df.res Pr(>F)
## group_sep 83.17 9 417.24 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il1_b)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_b_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -509.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.2908 -0.5140 -0.0895 0.2629 7.1938
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.003725 0.06103
## Residual 0.016117 0.12695
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 1.16016 0.02245 51.675
## group_sephealthy.000 -0.59874 0.03029 -19.768
## group_sepno_rejection.000 0.04741 0.02674 1.773
## group_sepacute_rejection.007 -0.05044 0.02816 -1.791
## group_sepno_rejection.007 -0.01361 0.02674 -0.509
## group_sepacute_rejection.090 -0.04086 0.02858 -1.430
## group_sepno_rejection.090 -0.07554 0.03155 -2.395
## group_sepacute_rejection.365 -0.05930 0.02992 -1.982
## group_sepno_rejection.365 -0.09149 0.03155 -2.900
## group_sepacute_rejection.biopsy -0.04640 0.03195 -1.453
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.741
## grp_sp_.000 -0.840 0.622
## grp_spc_.007 -0.661 0.490 0.555
## grp_spn_.007 -0.840 0.622 0.760 0.555
## grp_spc_.090 -0.654 0.485 0.549 0.520 0.549
## grp_spn_.090 -0.712 0.528 0.644 0.471 0.644 0.466
## grp_spc_.365 -0.627 0.465 0.526 0.498 0.526 0.492
## grp_spn_.365 -0.712 0.528 0.644 0.471 0.644 0.466
## grp_spct_r. -0.584 0.433 0.490 0.464 0.490 0.459
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.446
## grp_spn_.365 0.585 0.446
## grp_spct_r. 0.416 0.435 0.4164.2.2 Pairwise comparison
4.2.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.2.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il1_b_value, g2$il1_b_value, paired=FALSE)$p.value
}4.2.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il1_b_value) %>%
pivot_wider(names_from = group_sep, values_from = il1_b_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.2.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 1.007494e-20 black 1.100496e-19
## 2 healthy.000 no_rejection.007 1.048092e-20 black 1.100496e-19
## 3 healthy.000 no_rejection.090 1.941165e-14 black 6.224985e-14
## 4 healthy.000 no_rejection.365 2.074995e-14 black 6.224985e-14
## 5 healthy.000 acute_rejection.000 1.954387e-14 black 6.224985e-14
## 6 healthy.000 acute_rejection.007 3.839545e-15 black 2.687682e-14
## 7 healthy.000 acute_rejection.090 8.457201e-15 black 4.440030e-14
## 8 healthy.000 acute_rejection.365 1.162541e-13 black 3.051669e-13
## 9 healthy.000 acute_rejection.biopsy 4.140081e-12 black 9.660189e-12
## 10 no_rejection.000 acute_rejection.000 1.656273e-01 black 2.045985e-01
## 11 no_rejection.007 acute_rejection.007 3.029547e-02 black 4.241366e-02
## 12 no_rejection.090 acute_rejection.090 1.269805e-01 black 1.666619e-01
## 13 no_rejection.365 acute_rejection.365 1.059940e-02 black 1.712211e-02
## 16 no_rejection.090 acute_rejection.biopsy 2.524270e-01 black 2.944981e-01
## 17 no_rejection.365 acute_rejection.biopsy 2.029089e-02 black 3.043634e-02
## 18 no_rejection.000 no_rejection.007 8.577426e-05 blue3 1.801260e-04
## 21 no_rejection.007 no_rejection.090 1.573119e-03 blue3 3.003227e-03
## 23 no_rejection.090 no_rejection.365 5.391972e-01 blue3 5.391972e-01
## 24 acute_rejection.000 acute_rejection.007 5.187312e-03 red4 9.077796e-03
## 27 acute_rejection.007 acute_rejection.090 5.013747e-01 red4 5.264435e-01
## 29 acute_rejection.090 acute_rejection.365 4.890153e-01 red4 5.264435e-01
## only significant differences
pair_table %>% filter(p<0.05) %>% data.frame()
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 11 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 12 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 13 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 14 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 15 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 1.007494e-20 black 1.100496e-19
## 2 healthy.000 no_rejection.007 1.048092e-20 black 1.100496e-19
## 3 healthy.000 no_rejection.090 1.941165e-14 black 6.224985e-14
## 4 healthy.000 no_rejection.365 2.074995e-14 black 6.224985e-14
## 5 healthy.000 acute_rejection.000 1.954387e-14 black 6.224985e-14
## 6 healthy.000 acute_rejection.007 3.839545e-15 black 2.687682e-14
## 7 healthy.000 acute_rejection.090 8.457201e-15 black 4.440030e-14
## 8 healthy.000 acute_rejection.365 1.162541e-13 black 3.051669e-13
## 9 healthy.000 acute_rejection.biopsy 4.140081e-12 black 9.660189e-12
## 10 no_rejection.007 acute_rejection.007 3.029547e-02 black 4.241366e-02
## 11 no_rejection.365 acute_rejection.365 1.059940e-02 black 1.712211e-02
## 12 no_rejection.365 acute_rejection.biopsy 2.029089e-02 black 3.043634e-02
## 13 no_rejection.000 no_rejection.007 8.577426e-05 blue3 1.801260e-04
## 14 no_rejection.007 no_rejection.090 1.573119e-03 blue3 3.003227e-03
## 15 acute_rejection.000 acute_rejection.007 5.187312e-03 red4 9.077796e-03
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.2.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il1_b_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il1_b_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = expression("IL-1" * beta * " (pg/ml)")) +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 28)) +
annotate("text", x = 6, y = 10, label = "#", size = 7)
pair_rest$y <- c(19, 17, 19, 26.5, 21, 25)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il1_b <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+0.5,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il1_bOpen code
plotac <- 'plot_il1_b'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.3 il1_ra
4.3.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il1_ra_value))
## model fit
model_il1_ra <- lmer(log10(il1_ra_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il1_ra)Open code
## anova result od model
Anova(model_il1_ra, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_ra_value)
## F Df Df.res Pr(>F)
## group_sep 17.915 9 414.32 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il1_ra)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_ra_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 325.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.3924 -0.5919 -0.1109 0.4126 3.4509
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.02780 0.1667
## Residual 0.08388 0.2896
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.17638 0.05311 59.805
## group_sephealthy.000 -0.57937 0.07175 -8.075
## group_sepno_rejection.000 0.11718 0.06332 1.851
## group_sepacute_rejection.007 -0.12171 0.06428 -1.893
## group_sepno_rejection.007 -0.06739 0.06332 -1.064
## group_sepacute_rejection.090 -0.11194 0.06528 -1.715
## group_sepno_rejection.090 -0.06636 0.07428 -0.893
## group_sepacute_rejection.365 -0.28796 0.06841 -4.209
## group_sepno_rejection.365 -0.17831 0.07428 -2.400
## group_sepacute_rejection.biopsy -0.17195 0.07310 -2.352
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.740
## grp_sp_.000 -0.839 0.621
## grp_spc_.007 -0.639 0.473 0.536
## grp_spn_.007 -0.839 0.621 0.777 0.536
## grp_spc_.090 -0.632 0.468 0.530 0.520 0.530
## grp_spn_.090 -0.715 0.529 0.663 0.457 0.663 0.452
## grp_spc_.365 -0.605 0.448 0.508 0.498 0.508 0.492
## grp_spn_.365 -0.715 0.529 0.663 0.457 0.663 0.452
## grp_spct_r. -0.563 0.417 0.472 0.463 0.472 0.459
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.433
## grp_spn_.365 0.610 0.433
## grp_spct_r. 0.403 0.433 0.4034.3.2 Pairwise comparison
4.3.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.3.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il1_ra_value, g2$il1_ra_value, paired=FALSE)$p.value
}4.3.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il1_ra_value) %>%
pivot_wider(names_from = group_sep, values_from = il1_ra_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.3.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 6.278863e-18 black 1.318561e-16
## 2 healthy.000 no_rejection.007 4.243487e-16 black 4.455661e-15
## 3 healthy.000 no_rejection.090 1.424391e-11 black 9.970737e-11
## 4 healthy.000 no_rejection.365 6.321421e-09 black 1.896426e-08
## 5 healthy.000 acute_rejection.000 1.340189e-10 black 7.035992e-10
## 6 healthy.000 acute_rejection.007 2.975331e-10 black 1.249639e-09
## 7 healthy.000 acute_rejection.090 2.122261e-09 black 7.427913e-09
## 8 healthy.000 acute_rejection.365 9.383021e-06 black 2.189372e-05
## 9 healthy.000 acute_rejection.biopsy 1.355816e-07 black 3.559017e-07
## 10 no_rejection.000 acute_rejection.000 1.894461e-01 black 2.340216e-01
## 11 no_rejection.007 acute_rejection.007 6.256756e-02 black 9.581960e-02
## 12 no_rejection.090 acute_rejection.090 2.120715e-01 black 2.474167e-01
## 13 no_rejection.365 acute_rejection.365 6.387973e-02 black 9.581960e-02
## 16 no_rejection.090 acute_rejection.biopsy 1.110122e-01 black 1.554170e-01
## 17 no_rejection.365 acute_rejection.biopsy 8.746157e-01 black 8.746157e-01
## 18 no_rejection.000 no_rejection.007 6.409870e-05 blue3 1.346073e-04
## 21 no_rejection.007 no_rejection.090 5.571619e-01 blue3 6.158106e-01
## 23 no_rejection.090 no_rejection.365 2.581426e-02 blue3 4.517495e-02
## 24 acute_rejection.000 acute_rejection.007 1.422637e-01 red4 1.867211e-01
## 27 acute_rejection.007 acute_rejection.090 7.546941e-01 red4 7.924288e-01
## 29 acute_rejection.090 acute_rejection.365 2.400159e-02 red4 4.517495e-02
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 6.278863e-18 1.318561e-16
## 2 healthy vs. no rejection D_7 4.243487e-16 4.455661e-15
## 3 healthy vs. no rejection D_90 1.424391e-11 9.970737e-11
## 4 healthy vs. no rejection D_365 6.321421e-09 1.896426e-08
## 5 healthy vs. acute rejection D_0 1.340189e-10 7.035992e-10
## 6 healthy vs. acute rejection D_7 2.975331e-10 1.249639e-09
## 7 healthy vs. acute rejection D_90 2.122261e-09 7.427913e-09
## 8 healthy vs. acute rejection D_365 9.383021e-06 2.189372e-05
## 9 healthy vs. acute rejection D_biopsy 1.355816e-07 3.559017e-07
## 10 no rejection D_0 vs. no rejection D_7 6.409870e-05 1.346073e-04
## 11 no rejection D_90 vs. no rejection D_365 2.581426e-02 4.517495e-02
## 12 acute rejection D_90 vs. acute rejection D_365 2.400159e-02 4.517495e-02
## star
## 1 ***
## 2 ***
## 3 ***
## 4 ***
## 5 ***
## 6 ***
## 7 ***
## 8 ***
## 9 ***
## 10 ***
## 11 *
## 12 *
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.3.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il1_ra_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il1_ra_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = "IL-1 RA (pg/ml)") +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 7000)) +
annotate("text", x = 6, y = 2000, label = "#", size = 7)
pair_rest$y <- c(6900, 4000, 3600)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il1_ra <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+50,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il1_raOpen code
plotac <- 'plot_il1_ra'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.4 il18
4.4.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il18_value))
## model fit
model_il18 <- lmer(log10(il18_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il18)Open code
## anova result od model
Anova(model_il18, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_value)
## F Df Df.res Pr(>F)
## group_sep 23.496 9 412.76 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il18)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 290.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -5.4547 -0.5610 -0.0786 0.4362 3.2320
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.03004 0.1733
## Residual 0.07579 0.2753
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 2.706285 0.051611 52.436
## group_sephealthy.000 -0.433108 0.069774 -6.207
## group_sepno_rejection.000 0.181152 0.061559 2.943
## group_sepacute_rejection.007 -0.250706 0.061125 -4.102
## group_sepno_rejection.007 -0.173250 0.061559 -2.814
## group_sepacute_rejection.090 0.133694 0.062099 2.153
## group_sepno_rejection.090 0.124231 0.071958 1.726
## group_sepacute_rejection.365 0.050040 0.065106 0.769
## group_sepno_rejection.365 -0.003025 0.071958 -0.042
## group_sepacute_rejection.biopsy 0.127269 0.069595 1.829
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.740
## grp_sp_.000 -0.838 0.620
## grp_spc_.007 -0.626 0.463 0.525
## grp_spn_.007 -0.838 0.620 0.787 0.525
## grp_spc_.090 -0.619 0.458 0.519 0.521 0.519
## grp_spn_.090 -0.717 0.531 0.673 0.449 0.673 0.444
## grp_spc_.365 -0.593 0.438 0.497 0.498 0.497 0.492
## grp_spn_.365 -0.717 0.531 0.673 0.449 0.673 0.444
## grp_spct_r. -0.551 0.407 0.462 0.462 0.462 0.458
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.425
## grp_spn_.365 0.625 0.425
## grp_spct_r. 0.395 0.432 0.3954.4.2 Pairwise comparison
4.4.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.4.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il18_value, g2$il18_value, paired=FALSE)$p.value
}4.4.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il18_value) %>%
pivot_wider(names_from = group_sep, values_from = il18_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.4.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 1.671896e-16 black 3.510982e-15
## 2 healthy.000 no_rejection.007 8.598524e-08 black 2.006322e-07
## 3 healthy.000 no_rejection.090 2.667314e-13 black 1.867120e-12
## 4 healthy.000 no_rejection.365 2.761390e-10 black 8.284170e-10
## 5 healthy.000 acute_rejection.000 2.124780e-06 black 4.056397e-06
## 6 healthy.000 acute_rejection.007 4.471962e-02 black 5.524189e-02
## 7 healthy.000 acute_rejection.090 8.245243e-13 black 4.328752e-12
## 8 healthy.000 acute_rejection.365 1.675587e-12 black 7.037463e-12
## 9 healthy.000 acute_rejection.biopsy 4.551076e-11 black 1.592877e-10
## 10 no_rejection.000 acute_rejection.000 2.664446e-02 black 3.497086e-02
## 11 no_rejection.007 acute_rejection.007 1.305168e-01 black 1.522696e-01
## 12 no_rejection.090 acute_rejection.090 7.088759e-01 black 7.088759e-01
## 13 no_rejection.365 acute_rejection.365 1.722459e-02 black 2.411443e-02
## 16 no_rejection.090 acute_rejection.biopsy 3.083806e-01 black 3.237997e-01
## 17 no_rejection.365 acute_rejection.biopsy 2.268561e-03 black 3.664598e-03
## 18 no_rejection.000 no_rejection.007 1.006443e-13 blue3 1.056765e-12
## 21 no_rejection.007 no_rejection.090 1.011576e-07 blue3 2.124310e-07
## 23 no_rejection.090 no_rejection.365 6.539723e-03 blue3 9.809584e-03
## 24 acute_rejection.000 acute_rejection.007 4.081365e-05 red4 7.142390e-05
## 27 acute_rejection.007 acute_rejection.090 3.163223e-09 red4 8.303459e-09
## 29 acute_rejection.090 acute_rejection.365 2.312297e-01 red4 2.555696e-01
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 1.671896e-16 3.510982e-15
## 2 healthy vs. no rejection D_7 8.598524e-08 2.006322e-07
## 3 healthy vs. no rejection D_90 2.667314e-13 1.867120e-12
## 4 healthy vs. no rejection D_365 2.761390e-10 8.284170e-10
## 5 healthy vs. acute rejection D_0 2.124780e-06 4.056397e-06
## 6 healthy vs. acute rejection D_7 4.471962e-02 5.524189e-02
## 7 healthy vs. acute rejection D_90 8.245243e-13 4.328752e-12
## 8 healthy vs. acute rejection D_365 1.675587e-12 7.037463e-12
## 9 healthy vs. acute rejection D_biopsy 4.551076e-11 1.592877e-10
## 10 no rejection D_0 vs. acute rejection D_0 2.664446e-02 3.497086e-02
## 11 no rejection D_365 vs. acute rejection D_365 1.722459e-02 2.411443e-02
## 12 no rejection D_365 vs. acute rejection D_biopsy 2.268561e-03 3.664598e-03
## 13 no rejection D_0 vs. no rejection D_7 1.006443e-13 1.056765e-12
## 14 no rejection D_7 vs. no rejection D_90 1.011576e-07 2.124310e-07
## 15 no rejection D_90 vs. no rejection D_365 6.539723e-03 9.809584e-03
## 16 acute rejection D_0 vs. acute rejection D_7 4.081365e-05 7.142390e-05
## 17 acute rejection D_7 vs. acute rejection D_90 3.163223e-09 8.303459e-09
## star
## 1 ***
## 2 ***
## 3 ***
## 4 ***
## 5 ***
## 6 *
## 7 ***
## 8 ***
## 9 ***
## 10 *
## 11 *
## 12 **
## 13 ***
## 14 ***
## 15 **
## 16 ***
## 17 ***
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.4.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il18_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il18_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = "IL-18 (pg/ml)") +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 3000)) +
annotate("text", x = 6, y = 700, label = "#", size = 7)
pair_rest$y <- c(2700, 1000, 1700, 2900, 2300, 2100, 1900, 1700)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il18 <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+50,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il18Open code
plotac <- 'plot_il18'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.5 il18_bp
4.5.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il18_bp_value))
## model fit
model_il18_bp <- lmer(log10(il18_bp_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il18_bp)Open code
## anova result od model
Anova(model_il18_bp, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_bp_value)
## F Df Df.res Pr(>F)
## group_sep 8.4695 9 489.8 8.293e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il18_bp)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_bp_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -484.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -10.0578 -0.3070 0.0384 0.3462 4.8019
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.006046 0.07775
## Residual 0.018843 0.13727
## Number of obs: 577, groups: id, 169
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.614819 0.024804 145.735
## group_sephealthy.000 -0.165875 0.037658 -4.405
## group_sepno_rejection.000 0.004244 0.029707 0.143
## group_sepacute_rejection.007 -0.061525 0.030101 -2.044
## group_sepno_rejection.007 -0.046670 0.029665 -1.573
## group_sepacute_rejection.090 -0.121220 0.030711 -3.947
## group_sepno_rejection.090 -0.109015 0.029982 -3.636
## group_sepacute_rejection.365 -0.092007 0.031914 -2.883
## group_sepno_rejection.365 -0.121527 0.030184 -4.026
## group_sepacute_rejection.biopsy -0.053131 0.034328 -1.548
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.659
## grp_sp_.000 -0.835 0.550
## grp_spc_.007 -0.640 0.422 0.534
## grp_spn_.007 -0.836 0.551 0.771 0.535
## grp_spc_.090 -0.628 0.414 0.524 0.517 0.525
## grp_spn_.090 -0.827 0.545 0.763 0.529 0.764 0.520
## grp_spc_.365 -0.606 0.399 0.506 0.499 0.507 0.489
## grp_spn_.365 -0.822 0.541 0.758 0.526 0.759 0.516
## grp_spct_r. -0.556 0.366 0.464 0.458 0.465 0.449
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.501
## grp_spn_.365 0.752 0.498
## grp_spct_r. 0.460 0.428 0.4574.5.2 Pairwise comparison
4.5.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.5.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il18_bp_value, g2$il18_bp_value, paired=FALSE)$p.value
}4.5.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il18_bp_value) %>%
pivot_wider(names_from = group_sep, values_from = il18_bp_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.5.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 4.111120e-12 black 8.633353e-11
## 2 healthy.000 no_rejection.007 1.240228e-08 black 8.681598e-08
## 3 healthy.000 no_rejection.090 2.278600e-03 black 4.350054e-03
## 4 healthy.000 no_rejection.365 1.381490e-04 black 3.626412e-04
## 5 healthy.000 acute_rejection.000 1.711485e-09 black 1.797059e-08
## 6 healthy.000 acute_rejection.007 9.191676e-05 black 2.757503e-04
## 7 healthy.000 acute_rejection.090 4.719442e-02 black 6.607219e-02
## 8 healthy.000 acute_rejection.365 8.426347e-03 black 1.361179e-02
## 9 healthy.000 acute_rejection.biopsy 1.333362e-06 black 5.600122e-06
## 10 no_rejection.000 acute_rejection.000 3.168633e-01 black 3.696738e-01
## 11 no_rejection.007 acute_rejection.007 1.275900e-01 black 1.674619e-01
## 12 no_rejection.090 acute_rejection.090 4.543678e-01 black 5.021959e-01
## 13 no_rejection.365 acute_rejection.365 7.350379e-01 black 7.350379e-01
## 16 no_rejection.090 acute_rejection.biopsy 4.632816e-03 black 8.107427e-03
## 17 no_rejection.365 acute_rejection.biopsy 3.163257e-02 black 4.744886e-02
## 18 no_rejection.000 no_rejection.007 2.090599e-05 blue3 7.317096e-05
## 21 no_rejection.007 no_rejection.090 4.544604e-08 blue3 2.385917e-07
## 23 no_rejection.090 no_rejection.365 5.092835e-01 blue3 5.347477e-01
## 24 acute_rejection.000 acute_rejection.007 1.367483e-03 red4 2.943894e-03
## 27 acute_rejection.007 acute_rejection.090 1.401854e-03 red4 2.943894e-03
## 29 acute_rejection.090 acute_rejection.365 1.547263e-01 red4 1.911325e-01
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 4.111120e-12 8.633353e-11
## 2 healthy vs. no rejection D_7 1.240228e-08 8.681598e-08
## 3 healthy vs. no rejection D_90 2.278600e-03 4.350054e-03
## 4 healthy vs. no rejection D_365 1.381490e-04 3.626412e-04
## 5 healthy vs. acute rejection D_0 1.711485e-09 1.797059e-08
## 6 healthy vs. acute rejection D_7 9.191676e-05 2.757503e-04
## 7 healthy vs. acute rejection D_90 4.719442e-02 6.607219e-02
## 8 healthy vs. acute rejection D_365 8.426347e-03 1.361179e-02
## 9 healthy vs. acute rejection D_biopsy 1.333362e-06 5.600122e-06
## 10 no rejection D_90 vs. acute rejection D_biopsy 4.632816e-03 8.107427e-03
## 11 no rejection D_365 vs. acute rejection D_biopsy 3.163257e-02 4.744886e-02
## 12 no rejection D_0 vs. no rejection D_7 2.090599e-05 7.317096e-05
## 13 no rejection D_7 vs. no rejection D_90 4.544604e-08 2.385917e-07
## 14 acute rejection D_0 vs. acute rejection D_7 1.367483e-03 2.943894e-03
## 15 acute rejection D_7 vs. acute rejection D_90 1.401854e-03 2.943894e-03
## star
## 1 ***
## 2 ***
## 3 **
## 4 ***
## 5 ***
## 6 ***
## 7 *
## 8 **
## 9 ***
## 10 **
## 11 *
## 12 ***
## 13 ***
## 14 **
## 15 **
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.5.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il18_bp_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il18_bp_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = "IL-18 BP (pg/ml)") +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 7300)) +
annotate("text", x = 6, y = 5000, label = "#", size = 7)
pair_rest$y <- c(5800, 5500, 7200, 6900, 6400, 6100)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il18_bp <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+50,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il18_bpOpen code
plotac <- 'plot_il18_bp'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.6 il18_free
4.6.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il18_free))
## model fit
model_il18_free <- lmer(log10(il18_free) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il18_free)Open code
## anova result od model
Anova(model_il18_free, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_free)
## F Df Df.res Pr(>F)
## group_sep 19.077 9 401.57 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il18_free)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_free) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 247.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.4008 -0.5625 -0.0955 0.4128 3.3292
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.02494 0.1579
## Residual 0.07261 0.2695
## Number of obs: 481, groups: id, 169
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 2.51490 0.05020 50.101
## group_sephealthy.000 -0.33233 0.07528 -4.415
## group_sepno_rejection.000 0.16742 0.05973 2.803
## group_sepacute_rejection.007 -0.23114 0.06029 -3.834
## group_sepno_rejection.007 -0.16130 0.05964 -2.704
## group_sepacute_rejection.090 0.17291 0.06123 2.824
## group_sepno_rejection.090 0.14789 0.06978 2.119
## group_sepacute_rejection.365 0.07912 0.06415 1.233
## group_sepno_rejection.365 0.01916 0.06978 0.275
## group_sepacute_rejection.biopsy 0.14763 0.06836 2.160
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.667
## grp_sp_.000 -0.840 0.560
## grp_spc_.007 -0.643 0.429 0.540
## grp_spn_.007 -0.842 0.561 0.782 0.541
## grp_spc_.090 -0.636 0.424 0.535 0.528 0.536
## grp_spn_.090 -0.719 0.480 0.669 0.463 0.669 0.458
## grp_spc_.365 -0.610 0.407 0.513 0.506 0.514 0.500
## grp_spn_.365 -0.719 0.480 0.669 0.463 0.669 0.458
## grp_spct_r. -0.566 0.378 0.476 0.469 0.477 0.465
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.439
## grp_spn_.365 0.618 0.439
## grp_spct_r. 0.407 0.439 0.4074.6.2 Pairwise comparison
4.6.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.6.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il18_free, g2$il18_free, paired=FALSE)$p.value
}4.6.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il18_free) %>%
pivot_wider(names_from = group_sep, values_from = il18_free) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.6.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 1.195713e-10 black 4.184996e-10
## 2 healthy.000 no_rejection.007 1.125705e-04 black 2.363980e-04
## 3 healthy.000 no_rejection.090 1.142557e-13 black 2.382870e-12
## 4 healthy.000 no_rejection.365 2.897492e-09 black 7.605918e-09
## 5 healthy.000 acute_rejection.000 1.390081e-04 black 2.646890e-04
## 6 healthy.000 acute_rejection.007 2.848719e-01 black 3.148584e-01
## 7 healthy.000 acute_rejection.090 2.269400e-13 black 2.382870e-12
## 8 healthy.000 acute_rejection.365 1.488787e-12 black 1.042151e-11
## 9 healthy.000 acute_rejection.biopsy 1.051022e-10 black 4.184996e-10
## 10 no_rejection.000 acute_rejection.000 3.508526e-02 black 4.604940e-02
## 11 no_rejection.007 acute_rejection.007 9.916951e-02 black 1.225035e-01
## 12 no_rejection.090 acute_rejection.090 4.724356e-01 black 4.724356e-01
## 13 no_rejection.365 acute_rejection.365 1.561394e-02 black 2.185951e-02
## 16 no_rejection.090 acute_rejection.biopsy 3.794611e-01 black 3.984342e-01
## 17 no_rejection.365 acute_rejection.biopsy 3.232913e-03 black 5.222398e-03
## 18 no_rejection.000 no_rejection.007 6.418077e-12 blue3 3.369490e-11
## 21 no_rejection.007 no_rejection.090 3.163586e-08 blue3 7.381702e-08
## 23 no_rejection.090 no_rejection.365 5.187312e-03 blue3 7.780968e-03
## 24 acute_rejection.000 acute_rejection.007 1.512508e-04 red4 2.646890e-04
## 27 acute_rejection.007 acute_rejection.090 1.644366e-09 red4 4.933099e-09
## 29 acute_rejection.090 acute_rejection.365 1.776244e-01 red4 2.072284e-01
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 1.195713e-10 4.184996e-10
## 2 healthy vs. no rejection D_7 1.125705e-04 2.363980e-04
## 3 healthy vs. no rejection D_90 1.142557e-13 2.382870e-12
## 4 healthy vs. no rejection D_365 2.897492e-09 7.605918e-09
## 5 healthy vs. acute rejection D_0 1.390081e-04 2.646890e-04
## 6 healthy vs. acute rejection D_90 2.269400e-13 2.382870e-12
## 7 healthy vs. acute rejection D_365 1.488787e-12 1.042151e-11
## 8 healthy vs. acute rejection D_biopsy 1.051022e-10 4.184996e-10
## 9 no rejection D_0 vs. acute rejection D_0 3.508526e-02 4.604940e-02
## 10 no rejection D_365 vs. acute rejection D_365 1.561394e-02 2.185951e-02
## 11 no rejection D_365 vs. acute rejection D_biopsy 3.232913e-03 5.222398e-03
## 12 no rejection D_0 vs. no rejection D_7 6.418077e-12 3.369490e-11
## 13 no rejection D_7 vs. no rejection D_90 3.163586e-08 7.381702e-08
## 14 no rejection D_90 vs. no rejection D_365 5.187312e-03 7.780968e-03
## 15 acute rejection D_0 vs. acute rejection D_7 1.512508e-04 2.646890e-04
## 16 acute rejection D_7 vs. acute rejection D_90 1.644366e-09 4.933099e-09
## star
## 1 ***
## 2 ***
## 3 ***
## 4 ***
## 5 ***
## 6 ***
## 7 ***
## 8 ***
## 9 *
## 10 *
## 11 **
## 12 ***
## 13 ***
## 14 **
## 15 ***
## 16 ***
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()4.6.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il18_free)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il18_free)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = "Free IL-18 (pg/ml)") +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 1700)) +
annotate("text", x = 6, y = 500, label = "#", size = 7)
pair_rest$y <- c(1650, 700, 1060, 1720,
830, 1200, 1350, 1280)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il18_free <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+5,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il18_freeOpen code
plotac <- 'plot_il18_free'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}4.7 il36_b
4.7.1 Mixed model
Open code
## filtering data
model_data <- data_long %>%
filter(!is.na(il36_b_value))
## model fit
model_il36_b <- lmer(log10(il36_b_value) ~
group_sep +
(1|id), data = model_data)
## diagnostic plot of model
plot(model_il36_b)Open code
## anova result od model
Anova(model_il36_b, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il36_b_value)
## F Df Df.res Pr(>F)
## group_sep 13.599 9 411.76 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## model summary
summary(model_il36_b)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il36_b_value) ~ group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 566.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.3627 -0.3397 0.0080 0.4167 3.2126
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.05778 0.2404
## Residual 0.13031 0.3610
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.70905 0.06872 10.318
## group_sephealthy.000 -0.52054 0.09296 -5.600
## group_sepno_rejection.000 0.05180 0.08200 0.632
## group_sepacute_rejection.007 -0.16912 0.08016 -2.110
## group_sepno_rejection.007 -0.05161 0.08200 -0.629
## group_sepacute_rejection.090 -0.36787 0.08146 -4.516
## group_sepno_rejection.090 -0.13766 0.09559 -1.440
## group_sepacute_rejection.365 -0.52969 0.08543 -6.200
## group_sepno_rejection.365 -0.19032 0.09559 -1.991
## group_sepacute_rejection.biopsy -0.50731 0.09134 -5.554
##
## Correlation of Fixed Effects:
## (Intr) g_.000 g__.000 grp_spc_.007 grp_spn_.007 grp_spc_.090
## grp_sph.000 -0.739
## grp_sp_.000 -0.838 0.620
## grp_spc_.007 -0.616 0.456 0.517
## grp_spn_.007 -0.838 0.620 0.794 0.517
## grp_spc_.090 -0.610 0.451 0.511 0.521 0.511
## grp_spn_.090 -0.719 0.531 0.681 0.443 0.681 0.439
## grp_spc_.365 -0.584 0.432 0.489 0.498 0.489 0.492
## grp_spn_.365 -0.719 0.531 0.681 0.443 0.681 0.439
## grp_spct_r. -0.542 0.401 0.455 0.462 0.455 0.458
## grp_spn_.090 grp_spc_.365 grp_spn_.365
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090
## grp_spc_.365 0.420
## grp_spn_.365 0.634 0.420
## grp_spct_r. 0.390 0.432 0.3904.7.2 Pairwise comparison
4.7.2.1 List of contrasts
List of contrast names and left and right coordinates on the X axis
Open code
contrast <- c(
## healthy vs. others
"healthy vs. no rejection D_0",
"healthy vs. no rejection D_7",
"healthy vs. no rejection D_90",
"healthy vs. no rejection D_365",
"healthy vs. acute rejection D_0",
"healthy vs. acute rejection D_7",
"healthy vs. acute rejection D_90",
"healthy vs. acute rejection D_365",
"healthy vs. acute rejection D_biopsy",
## between-subjects comparisons
"no rejection D_0 vs. acute rejection D_0",
"no rejection D_7 vs. acute rejection D_7",
"no rejection D_90 vs. acute rejection D_90",
"no rejection D_365 vs. acute rejection D_365",
"no rejection D_0 vs. acute rejection D_biopsy",
"no rejection D_7 vs. acute rejection D_biopsy",
"no rejection D_90 vs. acute rejection D_biopsy",
"no rejection D_365 vs. acute rejection D_biopsy",
## within-subjects comparisons
### no rejection
"no rejection D_0 vs. no rejection D_7",
"no rejection D_0 vs. no rejection D_90",
"no rejection D_0 vs. no rejection D_365",
"no rejection D_7 vs. no rejection D_90",
"no rejection D_7 vs. no rejection D_365",
"no rejection D_90 vs. no rejection D_365",
### acute rejection
"acute rejection D_0 vs. acute rejection D_7",
"acute rejection D_0 vs. acute rejection D_90",
"acute rejection D_0 vs. acute rejection D_365",
"acute rejection D_7 vs. acute rejection D_90",
"acute rejection D_7 vs. acute rejection D_365",
"acute rejection D_90 vs. acute rejection D_365",
"acute rejection D_0 vs. acute rejection D_biopsy",
"acute rejection D_7 vs. acute rejection D_biopsy",
"acute rejection D_90 vs. acute rejection D_biopsy",
"acute rejection D_365 vs. acute rejection D_biopsy"
)
xcoord_1 <- c(rep(6, 9), seq(0.8, 3.8, 1), seq(0.8, 3.8, 1),
rep(0.8, 3), rep(1.8, 2), 2.8,
rep(1.2, 3), rep(2.2, 2), 3.2,
seq(1.2, 4.2, 1))
xcoord_2 <- c(seq(0.8, 3.8, 1), seq(1.2, 4.2, 1),
5, seq(1.2, 4.2, 1), rep(5, 4),
seq(1.8, 3.8, 1), 2.8, 3.8, 3.8,
2.2, 3.2, 4.2, 3.2, 4.2, 4.2,
rep(5, 4))
anot_coord <- (xcoord_1+xcoord_2)/2
pair_table <- data.frame(contrast, xcoord_1, xcoord_2,
anot_coord)
pair_table <- pair_table %>%
mutate(term1 = if_else(xcoord_1 == 6, 'healthy.000', 'other')) %>%
mutate(term1 = if_else(xcoord_1 == 0.8, 'no_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.8, 'no_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.8, 'no_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.8, 'no_rejection.365', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 5, 'acute_rejection.biopsy', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 1.2, 'acute_rejection.000', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 2.2, 'acute_rejection.007', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 3.2, 'acute_rejection.090', term1)) %>%
mutate(term1 = if_else(xcoord_1 == 4.2, 'acute_rejection.365', term1)) %>%
mutate(term2 = if_else(xcoord_2 == 6, 'healthy.000', 'other')) %>%
mutate(term2 = if_else(xcoord_2 == 0.8, 'no_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.8, 'no_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.8, 'no_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.8, 'no_rejection.365', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 5, 'acute_rejection.biopsy', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 1.2, 'acute_rejection.000', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 2.2, 'acute_rejection.007', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 3.2, 'acute_rejection.090', term2)) %>%
mutate(term2 = if_else(xcoord_2 == 4.2, 'acute_rejection.365', term2))
pair_table$p <- NA4.7.2.2 Between-subjects comparisons
Open code
set.seed(16)
for (i in 1:17){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i])|
group_sep == paste(pair_table$term2[i]))
g1 <- dat_pair %>% filter(group_sep == paste(pair_table$term1[i]))
g2 <- dat_pair %>% filter(group_sep == paste(pair_table$term2[i]))
pair_table$p[i] <- wilcox.test(g1$il36_b_value, g2$il36_b_value, paired=FALSE)$p.value
}4.7.2.3 Within-subject comparisons
Open code
set.seed(16)
for (i in 18:33){
dat_pair <- model_data %>%
filter(group_sep == paste(pair_table$term1[i]) |
group_sep == paste(pair_table$term2[i])) %>%
select(id, group_sep, il36_b_value) %>%
pivot_wider(names_from = group_sep, values_from = il36_b_value) %>%
filter(complete.cases(.)) %>% data.frame()
g1 <- dat_pair[,2]
g2 <- dat_pair[,3]
pair_table$p[i] <- wilcox.test(c(g1), c(g2), paired=TRUE)$p.value
}
pair_table <- pair_table[-c(14:15, 19:20, 22, 25:26, 28, 30:33),]
pair_table$cole <- c(rep("black", 15), rep("blue3", 3), rep("red4", 3))
pair_table$fdr <- p.adjust(pair_table$p, method = 'BH')4.7.2.4 Resulting table
Open code
## the whole `pair table`
pair_table
## contrast xcoord_1 xcoord_2 anot_coord
## 1 healthy vs. no rejection D_0 6.0 0.8 3.4
## 2 healthy vs. no rejection D_7 6.0 1.8 3.9
## 3 healthy vs. no rejection D_90 6.0 2.8 4.4
## 4 healthy vs. no rejection D_365 6.0 3.8 4.9
## 5 healthy vs. acute rejection D_0 6.0 1.2 3.6
## 6 healthy vs. acute rejection D_7 6.0 2.2 4.1
## 7 healthy vs. acute rejection D_90 6.0 3.2 4.6
## 8 healthy vs. acute rejection D_365 6.0 4.2 5.1
## 9 healthy vs. acute rejection D_biopsy 6.0 5.0 5.5
## 10 no rejection D_0 vs. acute rejection D_0 0.8 1.2 1.0
## 11 no rejection D_7 vs. acute rejection D_7 1.8 2.2 2.0
## 12 no rejection D_90 vs. acute rejection D_90 2.8 3.2 3.0
## 13 no rejection D_365 vs. acute rejection D_365 3.8 4.2 4.0
## 16 no rejection D_90 vs. acute rejection D_biopsy 2.8 5.0 3.9
## 17 no rejection D_365 vs. acute rejection D_biopsy 3.8 5.0 4.4
## 18 no rejection D_0 vs. no rejection D_7 0.8 1.8 1.3
## 21 no rejection D_7 vs. no rejection D_90 1.8 2.8 2.3
## 23 no rejection D_90 vs. no rejection D_365 2.8 3.8 3.3
## 24 acute rejection D_0 vs. acute rejection D_7 1.2 2.2 1.7
## 27 acute rejection D_7 vs. acute rejection D_90 2.2 3.2 2.7
## 29 acute rejection D_90 vs. acute rejection D_365 3.2 4.2 3.7
## term1 term2 p cole fdr
## 1 healthy.000 no_rejection.000 1.507542e-15 black 3.165839e-14
## 2 healthy.000 no_rejection.007 1.250083e-13 black 1.312587e-12
## 3 healthy.000 no_rejection.090 5.134600e-09 black 2.695665e-08
## 4 healthy.000 no_rejection.365 7.018490e-08 black 2.947766e-07
## 5 healthy.000 acute_rejection.000 1.419560e-11 black 9.936919e-11
## 6 healthy.000 acute_rejection.007 1.164937e-06 black 4.077280e-06
## 7 healthy.000 acute_rejection.090 3.199889e-02 black 4.799833e-02
## 8 healthy.000 acute_rejection.365 6.882559e-01 black 6.882559e-01
## 9 healthy.000 acute_rejection.biopsy 3.350608e-01 black 3.518138e-01
## 10 no_rejection.000 acute_rejection.000 1.489642e-01 black 1.747311e-01
## 11 no_rejection.007 acute_rejection.007 2.290071e-02 black 4.007624e-02
## 12 no_rejection.090 acute_rejection.090 8.967787e-04 black 2.354044e-03
## 13 no_rejection.365 acute_rejection.365 1.013818e-03 black 2.365575e-03
## 16 no_rejection.090 acute_rejection.biopsy 5.687729e-03 black 1.085839e-02
## 17 no_rejection.365 acute_rejection.biopsy 2.736817e-02 black 4.421013e-02
## 18 no_rejection.000 no_rejection.007 1.152029e-05 blue3 3.456087e-05
## 21 no_rejection.007 no_rejection.090 3.593050e-02 blue3 5.030269e-02
## 23 no_rejection.090 no_rejection.365 1.755844e-01 blue3 1.940670e-01
## 24 acute_rejection.000 acute_rejection.007 1.390606e-03 red4 2.920273e-03
## 27 acute_rejection.007 acute_rejection.090 5.156805e-02 red4 6.768306e-02
## 29 acute_rejection.090 acute_rejection.365 1.497695e-01 red4 1.747311e-01
## only significant differences
pair_table %>%
filter(p<0.05) %>%
select(contrast, p, fdr) %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()
## contrast p fdr
## 1 healthy vs. no rejection D_0 1.507542e-15 3.165839e-14
## 2 healthy vs. no rejection D_7 1.250083e-13 1.312587e-12
## 3 healthy vs. no rejection D_90 5.134600e-09 2.695665e-08
## 4 healthy vs. no rejection D_365 7.018490e-08 2.947766e-07
## 5 healthy vs. acute rejection D_0 1.419560e-11 9.936919e-11
## 6 healthy vs. acute rejection D_7 1.164937e-06 4.077280e-06
## 7 healthy vs. acute rejection D_90 3.199889e-02 4.799833e-02
## 8 no rejection D_7 vs. acute rejection D_7 2.290071e-02 4.007624e-02
## 9 no rejection D_90 vs. acute rejection D_90 8.967787e-04 2.354044e-03
## 10 no rejection D_365 vs. acute rejection D_365 1.013818e-03 2.365575e-03
## 11 no rejection D_90 vs. acute rejection D_biopsy 5.687729e-03 1.085839e-02
## 12 no rejection D_365 vs. acute rejection D_biopsy 2.736817e-02 4.421013e-02
## 13 no rejection D_0 vs. no rejection D_7 1.152029e-05 3.456087e-05
## 14 no rejection D_7 vs. no rejection D_90 3.593050e-02 5.030269e-02
## 15 acute rejection D_0 vs. acute rejection D_7 1.390606e-03 2.920273e-03
## star
## 1 ***
## 2 ***
## 3 ***
## 4 ***
## 5 ***
## 6 ***
## 7 *
## 8 *
## 9 ***
## 10 **
## 11 **
## 12 *
## 13 ***
## 14 *
## 15 **
pair_rest <- pair_table %>%
filter(p<0.05,
term1 != 'healthy.000') %>%
mutate(star = if_else(p<0.05, '*', '')) %>%
mutate(star = if_else(p<0.01, '**', star)) %>%
mutate(star = if_else(p<0.001, '***', star)) %>%
data.frame()Healthy does differ from all but acute rejection during biopsy and D365
4.7.3 Visualization
Open code
## plot
plotos <- data_long %>%
filter(!is.na(il36_b_value)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point)) %>%
## plotting
ggplot(aes(x=time_point, y=il36_b_value)) +
geom_boxplot(aes(fill=group, group = group_sep), outlier.shape = NA,
size=0.5,position = position_dodge(width = 0.84), color='black') +
labs(x = "Time post TX", y = expression("IL-36" * beta * " (pg/ml)")) +
scale_x_discrete(labels = c("Before TX", "7 days", "3 months", "365 days",
"Biopsy", "Healthy")) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 12),
legend.text = element_text(size = 11),
legend.title = element_text(size = 12)) +
scale_fill_manual(values = c("no_rejection" = "skyblue2",
"acute_rejection" = "coral",
"healthy" = "darkolivegreen3"),
labels = c("no rejection", "acute rejection", "healthy")) +
coord_cartesian(ylim = c(0, 15.5)) +
annotate("text", x = 6, y = 5, label = "#", size = 7)
pair_rest$y <- c(9.9, 7, 6.4, 9,
8.1, 15.5, 12.5, 11.5)
plotos <- plotos + geom_segment(data = pair_rest,
aes(x = xcoord_1, xend = xcoord_2, y = y, yend = y),
color = pair_rest$cole,
linetype = "solid", size = 0.4)
plot_il36_b <- plotos + annotate("text", x = pair_rest$anot_coord, y = pair_rest$y+0.15,
label = pair_rest$star, size = 7, color=pair_rest$cole)
plot_il36_bOpen code
plotac <- 'plot_il36_b'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 7.5, height = 5.6, units = "in")
}5 Correlation of ILs and renal function markers
5.1 Simple correlation matrix based on patient data
Open code
tr_cor <- patient_table %>%
filter(group != 'healthy') %>%
select(egfr_mean:il36_b_mean)
cor.mtest(tr_cor, conf.level = 0.95)
## $p
## egfr_mean creatinine_mean il1_a_mean il1_b_mean
## egfr_mean 0.000000e+00 1.703471e-16 6.479846e-01 3.032022e-01
## creatinine_mean 1.703471e-16 0.000000e+00 9.021567e-01 9.977320e-01
## il1_a_mean 6.479846e-01 9.021567e-01 0.000000e+00 5.817931e-18
## il1_b_mean 3.032022e-01 9.977320e-01 5.817931e-18 0.000000e+00
## il1_ra_mean 7.045108e-01 8.467688e-01 4.288839e-15 2.316736e-11
## il18_mean 8.197470e-01 7.603107e-01 1.680311e-15 7.659848e-14
## il18_bp_mean 1.793048e-01 2.193773e-01 3.841527e-01 7.085025e-01
## il18_free_mean 6.356508e-01 6.325962e-01 3.949705e-15 1.055580e-11
## il36_b_mean 2.629561e-01 3.896963e-01 9.302473e-05 8.379317e-06
## il1_ra_mean il18_mean il18_bp_mean il18_free_mean
## egfr_mean 7.045108e-01 8.197470e-01 0.1793048 6.356508e-01
## creatinine_mean 8.467688e-01 7.603107e-01 0.2193773 6.325962e-01
## il1_a_mean 4.288839e-15 1.680311e-15 0.3841527 3.949705e-15
## il1_b_mean 2.316736e-11 7.659848e-14 0.7085025 1.055580e-11
## il1_ra_mean 0.000000e+00 2.176954e-20 0.5645638 2.259573e-13
## il18_mean 2.176954e-20 0.000000e+00 0.9768424 6.833531e-85
## il18_bp_mean 5.645638e-01 9.768424e-01 0.0000000 4.524752e-01
## il18_free_mean 2.259573e-13 6.833531e-85 0.4524752 0.000000e+00
## il36_b_mean 2.540206e-02 1.512619e-03 0.3023744 1.849524e-03
## il36_b_mean
## egfr_mean 2.629561e-01
## creatinine_mean 3.896963e-01
## il1_a_mean 9.302473e-05
## il1_b_mean 8.379317e-06
## il1_ra_mean 2.540206e-02
## il18_mean 1.512619e-03
## il18_bp_mean 3.023744e-01
## il18_free_mean 1.849524e-03
## il36_b_mean 0.000000e+00
##
## $lowCI
## egfr_mean creatinine_mean il1_a_mean il1_b_mean il1_ra_mean
## egfr_mean 1.00000000 -0.71945843 -0.1287413 -0.08000879 -0.19859456
## creatinine_mean -0.71945843 1.00000000 -0.1773527 -0.16734220 -0.18319645
## il1_a_mean -0.12874134 -0.17735274 1.0000000 0.54243007 0.48621354
## il1_b_mean -0.08000879 -0.16734220 0.5424301 1.00000000 0.39813645
## il1_ra_mean -0.19859456 -0.18319645 0.4862135 0.39813645 1.00000000
## il18_mean -0.18607003 -0.14152112 0.4947200 0.45880699 0.58405262
## il18_bp_mean -0.27676849 -0.06299575 -0.2387838 -0.19815124 -0.21478835
## il18_free_mean -0.20638659 -0.12692277 0.4869689 0.40705248 0.44800513
## il36_b_mean -0.07231929 -0.23796415 0.1685782 0.21530828 0.02392036
## il18_mean il18_bp_mean il18_free_mean il36_b_mean
## egfr_mean -0.1860700 -0.27676849 -0.2063866 -0.07231929
## creatinine_mean -0.1415211 -0.06299575 -0.1269228 -0.23796415
## il1_a_mean 0.4947200 -0.23878380 0.4869689 0.16857815
## il1_b_mean 0.4588070 -0.19815124 0.4070525 0.21530828
## il1_ra_mean 0.5840526 -0.21478835 0.4480051 0.02392036
## il18_mean 1.0000000 -0.16467977 0.9574656 0.10512859
## il18_bp_mean -0.1646798 1.00000000 -0.2291107 -0.07985789
## il18_free_mean 0.9574656 -0.22911074 1.0000000 0.10003378
## il36_b_mean 0.1051286 -0.07985789 0.1000338 1.00000000
##
## $uppCI
## egfr_mean creatinine_mean il1_a_mean il1_b_mean il1_ra_mean
## egfr_mean 1.00000000 -0.51473305 0.20496892 0.2516687 0.1352705
## creatinine_mean -0.51473305 1.00000000 0.15682070 0.1668675 0.1509237
## il1_a_mean 0.20496892 0.15682070 1.00000000 0.7374956 0.7005925
## il1_b_mean 0.25166866 0.16686745 0.73749557 1.0000000 0.6403732
## il1_ra_mean 0.13527046 0.15092370 0.70059252 0.6403732 1.0000000
## il18_mean 0.14801517 0.19246549 0.70625117 0.6821760 0.7640880
## il18_bp_mean 0.05314448 0.26761624 0.09361479 0.1357235 0.1186266
## il18_free_mean 0.12728530 0.20673935 0.70109612 0.6466077 0.6748387
## il36_b_mean 0.25889897 0.09447614 0.46805481 0.5050816 0.3463574
## il18_mean il18_bp_mean il18_free_mean il36_b_mean
## egfr_mean 0.1480152 0.05314448 0.1272853 0.25889897
## creatinine_mean 0.1924655 0.26761624 0.2067394 0.09447614
## il1_a_mean 0.7062512 0.09361479 0.7010961 0.46805481
## il1_b_mean 0.6821760 0.13572347 0.6466077 0.50508160
## il1_ra_mean 0.7640880 0.11862657 0.6748387 0.34635737
## il18_mean 1.0000000 0.16952788 0.9781094 0.41603888
## il18_bp_mean 0.1695279 1.00000000 0.1037483 0.25181091
## il18_free_mean 0.9781094 0.10374828 1.0000000 0.41177200
## il36_b_mean 0.4160389 0.25181091 0.4117720 1.00000000
tr_cor <- cor(tr_cor, method='spearman',
use = 'pairwise.complete.obs')
corrplot(tr_cor, addCoef.col = 'black',tl.col = "white")
text(1:9, 9.9, expression("eGFR", "Creatinine", "IL-1" * alpha,
"IL-1" * beta, "IL-1 RA", "IL-18", "IL-18 BP",
"IL-18 (free)", "IL-36" * beta))
text(-0.1, 9:1, expression("eGFR", "Creatinine", "IL-1" * alpha,
"IL-1" * beta, "IL-1 RA", "IL-18", "IL-18 BP",
"IL-18 (free)", "IL-1" * beta))Open code
plotac <- 'cormat'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
pdf(path, height = 9, width = 10)
corrplot(tr_cor, addCoef.col = 'black',tl.col = "white")
text(1:9, 9.9, expression("eGFR", "Creatinine", "IL-1" * alpha,
"IL-1" * beta, "IL-1 RA", "IL-18", "IL-18 BP",
"IL-18 (free)", "IL-36" * beta))
text(-0.1, 9:1, expression("eGFR", "Creatinine", "IL-1" * alpha,
"IL-1" * beta, "IL-1 RA", "IL-18", "IL-18 BP",
"IL-18 (free)", "IL-1" * beta))
dev.off()
}There is not any significant correlation between interleukins and markers of renal function. At least modest (but still not statistically significant) correlation is for interleukin-18BP.
5.2 Adjsuting IL-18BP model for renal function
To further validate that renal functions does not play an important role for above-shown findings, we will re-fit mixed-effects model adjusting also for the effect of renal function. We will do it only for IL-18BP where modest correlation between average values of renal markers and IL-18BP levels was found.
5.2.1 Adjustment for EGFR
Open code
model_data <- data_long %>%
filter(!is.na(il18_bp_value))
## Complex models (including biopsy data)
model_il18_bp <- lmer(log10(il18_bp_value) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR_REML <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_bp_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_bp_value)
## F Df Df.res Pr(>F)
## log2(egfr) 7.8585 1 546.93 0.005238 **
## group_sep 0.8511 9 498.72 0.569269
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il18_bp_adjEGFR_REML)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_bp_value) ~ log2(egfr) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -484.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -10.0625 -0.3093 0.0385 0.3264 4.7337
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.005821 0.0763
## Residual 0.018697 0.1367
## Number of obs: 577, groups: id, 169
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.542135 0.035688 99.252
## log2(egfr) -0.023357 0.008296 -2.815
## group_sephealthy.000 -0.082801 0.047633 -1.738
## group_sepno_rejection.000 0.003459 0.029492 0.117
## group_sepacute_rejection.007 -0.023052 0.032957 -0.699
## group_sepno_rejection.007 -0.008397 0.032441 -0.259
## group_sepacute_rejection.090 -0.061571 0.037216 -1.654
## group_sepno_rejection.090 -0.044082 0.037664 -1.170
## group_sepacute_rejection.365 -0.030680 0.038551 -0.796
## group_sepno_rejection.365 -0.054855 0.038197 -1.436
## group_sepacute_rejection.biopsy -0.015372 0.036723 -0.419
##
## Correlation of Fixed Effects:
## (Intr) lg2(g) g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log2(egfr) 0.724
## grp_sph.000 -0.805 -0.620
## grp_sp_.000 -0.570 0.009 0.426
## grp_spc_.007 -0.704 -0.415 0.559 0.484
## grp_spn_.007 -0.827 -0.420 0.652 0.695 0.618
## grp_spc_.090 -0.770 -0.570 0.621 0.427 0.623 0.632
## grp_spn_.090 -0.895 -0.613 0.718 0.596 0.636 0.804
## grp_spc_.365 -0.755 -0.566 0.610 0.413 0.609 0.618
## grp_spn_.365 -0.894 -0.620 0.718 0.588 0.634 0.799
## grp_spct_r. -0.623 -0.365 0.495 0.431 0.540 0.547
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log2(egfr)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.688
## grp_spc_.365 0.653 0.674
## grp_spn_.365 0.687 0.845 0.674
## grp_spct_r. 0.552 0.563 0.536 0.561
AIC(model_il18_bp, model_il18_bp_adjEGFR)
## df AIC
## model_il18_bp 12 -519.0147
## model_il18_bp_adjEGFR 13 -525.0211
BIC(model_il18_bp, model_il18_bp_adjEGFR)
## df BIC
## model_il18_bp 12 -466.7206
## model_il18_bp_adjEGFR 13 -468.3692
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_bp_value),
group != 'healthy',
time_point != 'biopsy')
model_il18_bp <- lmer(log10(il18_bp_value) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR_REML <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_bp_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_bp_value)
## F Df Df.res Pr(>F)
## log2(egfr) 8.2667 1 493.18 0.004212 **
## group 0.0384 1 136.82 0.844997
## time_point 1.1641 3 427.73 0.323071
## group:time_point 0.4739 3 383.89 0.700648
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il18_bp_adjEGFR_REML)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_bp_value) ~ log2(egfr) + group * time_point + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -395.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -9.6486 -0.3004 0.0313 0.3514 4.5298
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.006349 0.07968
## Residual 0.020293 0.14245
## Number of obs: 518, groups: id, 138
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.537897 0.032802 107.857
## log2(egfr) -0.025804 0.008935 -2.888
## groupacute_rejection -0.003279 0.030746 -0.107
## time_point007 -0.007764 0.025645 -0.303
## time_point090 -0.040654 0.032968 -1.233
## time_point365 -0.051254 0.033664 -1.522
## groupacute_rejection:time_point007 -0.011354 0.037557 -0.302
## groupacute_rejection:time_point090 -0.014850 0.038431 -0.386
## groupacute_rejection:time_point365 0.027874 0.039646 0.703
##
## Correlation of Fixed Effects:
## (Intr) lg2(g) grpct_ tm_007 tm_090 tm_365 g_:_00 g_:_09
## log2(egfr) 0.857
## grpct_rjctn -0.292 -0.010
## time_pnt007 -0.759 -0.583 0.283
## time_pnt090 -0.856 -0.763 0.223 0.703
## time_pnt365 -0.854 -0.766 0.219 0.700 0.782
## grpct_:_007 0.183 0.006 -0.635 -0.455 -0.181 -0.178
## grpct_:_090 0.226 0.062 -0.622 -0.258 -0.406 -0.217 0.509
## grpct_:_365 0.216 0.056 -0.604 -0.247 -0.210 -0.393 0.494 0.486
AIC(model_il18_bp, model_il18_bp_adjEGFR)
## df AIC
## model_il18_bp 10 -422.7043
## model_il18_bp_adjEGFR 11 -429.0970
BIC(model_il18_bp, model_il18_bp_adjEGFR)
## df BIC
## model_il18_bp 10 -380.2045
## model_il18_bp_adjEGFR 11 -382.3473Inclusion of EGFR improves the fit slightly
5.2.2 Adjustment for creatinine
Open code
## Complex models (including healthy and biopsy data)
model_data <- data_long %>%
filter(!is.na(il18_bp_value))
model_il18_bp <- lmer(log10(il18_bp_value) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjCRE <- lmer(log10(il18_bp_value) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjCRE_REML <- lmer(log10(il18_bp_value) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_bp_adjCRE_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_bp_value)
## F Df Df.res Pr(>F)
## log2(creatinine) 8.3759 1 533.76 0.003958 **
## group_sep 0.8498 9 499.16 0.570427
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il18_bp_adjCRE_REML)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il18_bp_value) ~ log2(creatinine) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -485.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -10.0605 -0.3098 0.0338 0.3375 4.7538
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.00579 0.07609
## Residual 0.01869 0.13673
## Number of obs: 577, groups: id, 169
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.347354 0.095264 35.138
## log2(creatinine) 0.028584 0.009834 2.907
## group_sephealthy.000 -0.081148 0.047392 -1.712
## group_sepno_rejection.000 0.004485 0.029471 0.152
## group_sepacute_rejection.007 -0.022536 0.032851 -0.686
## group_sepno_rejection.007 -0.006951 0.032453 -0.214
## group_sepacute_rejection.090 -0.060552 0.037036 -1.635
## group_sepno_rejection.090 -0.042212 0.037600 -1.123
## group_sepacute_rejection.365 -0.029346 0.038423 -0.764
## group_sepno_rejection.365 -0.052683 0.038184 -1.380
## group_sepacute_rejection.biopsy -0.014549 0.036669 -0.397
##
## Correlation of Fixed Effects:
## (Intr) lg2(c) g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log2(crtnn) -0.966
## grp_sph.000 -0.729 0.615
## grp_sp_.000 -0.219 0.003 0.436
## grp_spc_.007 -0.546 0.409 0.556 0.491
## grp_spn_.007 -0.603 0.422 0.653 0.699 0.617
## grp_spc_.090 -0.679 0.564 0.617 0.437 0.621 0.632
## grp_spn_.090 -0.760 0.612 0.716 0.604 0.634 0.805
## grp_spc_.365 -0.673 0.562 0.607 0.422 0.607 0.618
## grp_spn_.365 -0.766 0.620 0.716 0.595 0.631 0.800
## grp_spct_r. -0.484 0.362 0.493 0.436 0.538 0.547
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log2(crtnn)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.686
## grp_spc_.365 0.651 0.673
## grp_spn_.365 0.685 0.845 0.673
## grp_spct_r. 0.550 0.562 0.534 0.560
AIC(model_il18_bp, model_il18_bp_adjCRE)
## df AIC
## model_il18_bp 12 -519.0147
## model_il18_bp_adjCRE 13 -525.5405
BIC(model_il18_bp, model_il18_bp_adjCRE)
## df BIC
## model_il18_bp 12 -466.7206
## model_il18_bp_adjCRE 13 -468.8886
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_bp_value),
group != 'healthy',
time_point != 'biopsy')
model_il18_bp <- lmer(log10(il18_bp_value) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_bp_adjEGFR_REML <- lmer(log10(il18_bp_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_bp_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_bp_value)
## F Df Df.res Pr(>F)
## log2(egfr) 8.2667 1 493.18 0.004212 **
## group 0.0384 1 136.82 0.844997
## time_point 1.1641 3 427.73 0.323071
## group:time_point 0.4739 3 383.89 0.700648
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_bp, model_il18_bp_adjEGFR)
## df AIC
## model_il18_bp 10 -422.7043
## model_il18_bp_adjEGFR 11 -429.0970
BIC(model_il18_bp, model_il18_bp_adjEGFR)
## df BIC
## model_il18_bp 10 -380.2045
## model_il18_bp_adjEGFR 11 -382.3473The analysis shows that when renal function are accounted for (included as a covariate to the mixed-effects model), there is no remaining variability explainable by other factors such as group [acute rejection/no rejection/healthy], time_point and group:timepoint interaction. It suggests that IL-18BP might be driven mainly with renal function and its change over time whereas the effects of group and timepoint etc may be indirect.
5.3 Adjusted free IL-18 model
Given that IL-18BP is seemingly affected with renal function, and the IL18-BP affects level of other forms of IL-18 (including free IL-18), we will fit model explaining the IL-18 levels but simultaneously adjusting for renal functions
5.3.1 Adjustment for EGFR
Open code
model_data <- data_long %>%
filter(!is.na(il18_free))
## Complex models (incuding healthy and biopsy data)
model_il18_free <- lmer(log10(il18_free) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR <- lmer(log10(il18_free) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR_REML <- lmer(log10(il18_free) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_free_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_free)
## F Df Df.res Pr(>F)
## log2(egfr) 0.3976 1 453.97 0.5287
## group_sep 18.1467 9 408.33 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_free, model_il18_free_adjEGFR)
## df AIC
## model_il18_free 12 227.9601
## model_il18_free_adjEGFR 13 229.5492
BIC(model_il18_free, model_il18_free_adjEGFR)
## df BIC
## model_il18_free 12 278.0706
## model_il18_free_adjEGFR 13 283.8355
## contrasts
em_il18_free <- emmeans(model_il18_free_adjEGFR_REML, specs = pairwise ~ group_sep,
adjust = 'none', type = 'response')
em_il18_free_cont <- data.frame(em_il18_free$contrasts)[c(
1:3, 10:17, 19, 25, 26, 32, 36, 37, 39, 42, 43, 45
),]
as_tibble(em_il18_free_cont) %>%
filter(p.value<0.05) %>% data.frame()
## contrast ratio SE df null
## 1 acute_rejection.000 / healthy.000 2.3488299 0.52463922 435.0740 1
## 2 acute_rejection.000 / no_rejection.000 0.6796674 0.09357705 425.4121 1
## 3 acute_rejection.000 / acute_rejection.007 1.7754537 0.27332184 368.5555 1
## 4 healthy.000 / no_rejection.000 0.2893642 0.05954896 432.7158 1
## 5 healthy.000 / no_rejection.007 0.6430489 0.10750560 418.1828 1
## 6 healthy.000 / acute_rejection.090 0.3047300 0.05347255 415.9992 1
## 7 healthy.000 / no_rejection.090 0.3243072 0.05640922 443.7439 1
## 8 healthy.000 / acute_rejection.365 0.3787470 0.06825834 424.0338 1
## 9 healthy.000 / no_rejection.365 0.4370688 0.07578081 443.8572 1
## 10 healthy.000 / acute_rejection.biopsy 0.3155659 0.06322568 447.4708 1
## 11 no_rejection.000 / no_rejection.007 2.2222820 0.24953180 406.4251 1
## 12 acute_rejection.007 / acute_rejection.090 0.4031414 0.05659525 338.0270 1
## 13 no_rejection.007 / no_rejection.090 0.5043273 0.06596023 391.6860 1
## t.ratio p.value
## 1 3.823020 1.510645e-04
## 2 -2.804691 5.267279e-03
## 3 3.728973 2.224936e-04
## 4 -6.025825 3.602854e-09
## 5 -2.641056 8.574436e-03
## 6 -6.772065 4.343067e-11
## 7 -6.473954 2.533892e-10
## 8 -5.387188 1.189046e-07
## 9 -4.773588 2.461121e-06
## 10 -5.756677 1.594912e-08
## 11 7.111595 5.203142e-12
## 12 -6.471233 3.415666e-10
## 13 -5.233867 2.712457e-07
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_free),
group != 'healthy',
time_point != 'biopsy')
model_il18_free <- lmer(log10(il18_free) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR <- lmer(log10(il18_free) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR_REML <- lmer(log10(il18_free) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_free_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_free)
## F Df Df.res Pr(>F)
## log2(egfr) 0.7728 1 401.47 0.3799
## group 1.7454 1 127.33 0.1888
## time_point 37.8641 3 333.92 <2e-16 ***
## group:time_point 2.8780 3 300.11 0.0363 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_free, model_il18_free_adjEGFR)
## df AIC
## model_il18_free 10 228.2280
## model_il18_free_adjEGFR 11 229.4307
BIC(model_il18_free, model_il18_free_adjEGFR)
## df BIC
## model_il18_free 10 268.6781
## model_il18_free_adjEGFR 11 273.9257Inclusion of EGFR improves the fit noticeably
5.3.2 Adjustment for creatinine
Open code
## Complex models (including healthy and biopsy data)
model_data <- data_long %>%
filter(!is.na(il18_free))
model_il18_free <- lmer(log10(il18_free) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjCRE <- lmer(log10(il18_free) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjCRE_REML <- lmer(log10(il18_free) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_free_adjCRE_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_free)
## F Df Df.res Pr(>F)
## log2(creatinine) 0.0042 1 445.45 0.9486
## group_sep 17.9284 9 408.53 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_free, model_il18_free_adjCRE)
## df AIC
## model_il18_free 12 227.9601
## model_il18_free_adjCRE 13 229.9558
BIC(model_il18_free, model_il18_free_adjCRE)
## df BIC
## model_il18_free 12 278.0706
## model_il18_free_adjCRE 13 284.2420
## contrasts
em_il18_free <- emmeans(model_il18_free_adjCRE_REML, specs = pairwise ~ group_sep,
adjust = 'none', type = 'response')
em_il18_free_cont <- data.frame(em_il18_free$contrasts)[c(
1:3, 10:17, 19, 25, 26, 32, 36, 37, 39, 42, 43, 45
),]
as_tibble(em_il18_free_cont) %>%
filter(p.value<0.05) %>% data.frame()
## contrast ratio SE df null
## 1 acute_rejection.000 / healthy.000 2.1687664 0.48197348 431.5196 1
## 2 acute_rejection.000 / no_rejection.000 0.6801392 0.09367971 425.4458 1
## 3 acute_rejection.000 / acute_rejection.007 1.7098365 0.26236203 369.0282 1
## 4 healthy.000 / no_rejection.000 0.3136065 0.06372205 426.9675 1
## 5 healthy.000 / no_rejection.007 0.6712961 0.11157823 415.2644 1
## 6 healthy.000 / acute_rejection.090 0.3116396 0.05468327 415.0644 1
## 7 healthy.000 / no_rejection.090 0.3302842 0.05736018 443.1981 1
## 8 healthy.000 / acute_rejection.365 0.3868350 0.06967426 423.2379 1
## 9 healthy.000 / no_rejection.365 0.4443414 0.07690988 443.4323 1
## 10 healthy.000 / acute_rejection.biopsy 0.3295687 0.06589444 445.4547 1
## 11 no_rejection.000 / no_rejection.007 2.1405683 0.23844979 407.9262 1
## 12 acute_rejection.007 / acute_rejection.090 0.3952854 0.05549189 337.8370 1
## 13 no_rejection.007 / no_rejection.090 0.4920096 0.06430945 391.7041 1
## t.ratio p.value
## 1 3.483530 5.454018e-04
## 2 -2.798524 5.367017e-03
## 3 3.495752 5.302759e-04
## 4 -5.707023 2.153363e-08
## 5 -2.397795 1.693480e-02
## 6 -6.644501 9.579112e-11
## 7 -6.378805 4.495745e-10
## 8 -5.273098 2.144034e-07
## 9 -4.686432 3.704435e-06
## 10 -5.551478 4.873878e-08
## 11 6.832152 3.054440e-11
## 12 -6.611471 1.486881e-10
## 13 -5.426283 1.010181e-07
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_free),
group != 'healthy',
time_point != 'biopsy')
model_il18_free <- lmer(log10(il18_free) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR <- lmer(log10(il18_free) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_free_adjEGFR_REML <- lmer(log10(il18_free) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_free_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_free)
## F Df Df.res Pr(>F)
## log2(egfr) 0.7728 1 401.47 0.3799
## group 1.7454 1 127.33 0.1888
## time_point 37.8641 3 333.92 <2e-16 ***
## group:time_point 2.8780 3 300.11 0.0363 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_free, model_il18_free_adjEGFR)
## df AIC
## model_il18_free 10 228.2280
## model_il18_free_adjEGFR 11 229.4307
BIC(model_il18_free, model_il18_free_adjEGFR)
## df BIC
## model_il18_free 10 268.6781
## model_il18_free_adjEGFR 11 273.9257Adjustment for renal function does not modify result of the model explaining free IL-18. Markers of renal function do not clearly affect the pattern of difference in free IL-18 levels across groups or time points
What about total IL-18?
5.4 Adjusted total IL-18 model
5.4.1 Adjustment for EGFR
Open code
model_data <- data_long %>%
filter(!is.na(il18_value))
## Complex models (incuding healthy and biopsy data)
model_il18_value <- lmer(log10(il18_value) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR <- lmer(log10(il18_value) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR_REML <- lmer(log10(il18_value) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_value_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_value)
## F Df Df.res Pr(>F)
## log2(egfr) 0.0043 1 479.54 0.9478
## group_sep 20.1828 9 420.08 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_value, model_il18_value_adjEGFR)
## df AIC
## model_il18_value 12 271.2115
## model_il18_value_adjEGFR 13 273.2071
BIC(model_il18_value, model_il18_value_adjEGFR)
## df BIC
## model_il18_value 12 321.7868
## model_il18_value_adjEGFR 13 327.9970
## contrasts
em_il18_value <- emmeans(model_il18_value_adjEGFR_REML, specs = pairwise ~ group_sep,
adjust = 'none', type = 'response')
em_il18_value_cont <- data.frame(em_il18_value$contrasts)[c(
1:3, 10:17, 19, 25, 26, 32, 36, 37, 39, 42, 43, 45
),]
as_tibble(em_il18_value_cont) %>%
filter(p.value<0.05) %>% data.frame()
## contrast ratio SE df null
## 1 acute_rejection.000 / healthy.000 2.7366486 0.59218436 454.5158 1
## 2 acute_rejection.000 / no_rejection.000 0.6589110 0.09351496 431.4245 1
## 3 acute_rejection.000 / acute_rejection.007 1.7891779 0.28041128 375.4567 1
## 4 healthy.000 / no_rejection.000 0.2407730 0.04744525 455.4358 1
## 5 healthy.000 / acute_rejection.007 0.6537843 0.11424656 430.7351 1
## 6 healthy.000 / no_rejection.007 0.5469397 0.08420175 434.3973 1
## 7 healthy.000 / acute_rejection.090 0.2704291 0.04434280 427.4637 1
## 8 healthy.000 / no_rejection.090 0.2765082 0.04473371 467.2332 1
## 9 healthy.000 / acute_rejection.365 0.3279225 0.05553422 439.1425 1
## 10 healthy.000 / no_rejection.365 0.3707291 0.05974592 467.3285 1
## 11 healthy.000 / acute_rejection.biopsy 0.2737829 0.05246003 468.9532 1
## 12 no_rejection.000 / no_rejection.007 2.2715995 0.26072382 414.2078 1
## 13 acute_rejection.007 / acute_rejection.090 0.4136365 0.05941427 342.5880 1
## 14 no_rejection.007 / no_rejection.090 0.5055551 0.06784174 396.6816 1
## t.ratio p.value
## 1 4.652398 4.309370e-06
## 2 -2.939378 3.465346e-03
## 3 3.711924 2.368372e-04
## 4 -7.225946 2.110790e-12
## 5 -2.431967 1.542367e-02
## 6 -3.919545 1.030440e-04
## 7 -7.975418 1.403525e-14
## 8 -7.946029 1.453800e-14
## 9 -6.583803 1.311307e-10
## 10 -6.157214 1.596165e-09
## 11 -6.760647 4.095282e-11
## 12 7.148604 3.988679e-12
## 13 -6.145745 2.211641e-09
## 14 -5.082980 5.736705e-07
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_value),
group != 'healthy',
time_point != 'biopsy')
model_il18_value <- lmer(log10(il18_value) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR <- lmer(log10(il18_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR_REML <- lmer(log10(il18_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_value_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_value)
## F Df Df.res Pr(>F)
## log2(egfr) 0.2022 1 404.42 0.65323
## group 2.5078 1 127.57 0.11576
## time_point 38.4486 3 335.61 < 2e-16 ***
## group:time_point 2.9888 3 301.05 0.03135 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_value, model_il18_value_adjEGFR)
## df AIC
## model_il18_value 10 229.1316
## model_il18_value_adjEGFR 11 230.9228
BIC(model_il18_value, model_il18_value_adjEGFR)
## df BIC
## model_il18_value 10 269.6289
## model_il18_value_adjEGFR 11 275.46995.4.2 Adjustment for creatinine
Open code
## Complex models (including healthy and biopsy data)
model_data <- data_long %>%
filter(!is.na(il18_value))
model_il18_value <- lmer(log10(il18_value) ~
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjCRE <- lmer(log10(il18_value) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjCRE_REML <- lmer(log10(il18_value) ~ log2(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_value_adjCRE_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_value)
## F Df Df.res Pr(>F)
## log2(creatinine) 0.1826 1 471.48 0.6693
## group_sep 19.9379 9 420.40 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_value, model_il18_value_adjCRE)
## df AIC
## model_il18_value 12 271.2115
## model_il18_value_adjCRE 13 273.0252
BIC(model_il18_value, model_il18_value_adjCRE)
## df BIC
## model_il18_value 12 321.7868
## model_il18_value_adjCRE 13 327.8151
## contrasts
em_il18_value <- emmeans(model_il18_value_adjCRE_REML, specs = pairwise ~ group_sep,
adjust = 'none', type = 'response')
em_il18_value_cont <- data.frame(em_il18_value$contrasts)[c(
1:3, 10:17, 19, 25, 26, 32, 36, 37, 39, 42, 43, 45
),]
as_tibble(em_il18_value_cont) %>%
filter(p.value<0.05) %>% data.frame()
## contrast ratio SE df null
## 1 acute_rejection.000 / healthy.000 2.5491151 0.55024547 450.2040 1
## 2 acute_rejection.000 / no_rejection.000 0.6585453 0.09341961 431.9527 1
## 3 acute_rejection.000 / acute_rejection.007 1.7307579 0.27030730 376.2757 1
## 4 healthy.000 / no_rejection.000 0.2583427 0.05035946 448.3507 1
## 5 healthy.000 / acute_rejection.007 0.6789642 0.11879800 429.1311 1
## 6 healthy.000 / no_rejection.007 0.5679693 0.08710035 430.8613 1
## 7 healthy.000 / acute_rejection.090 0.2759596 0.04529612 426.9497 1
## 8 healthy.000 / no_rejection.090 0.2809836 0.04540849 466.6953 1
## 9 healthy.000 / acute_rejection.365 0.3341813 0.05660218 438.4997 1
## 10 healthy.000 / no_rejection.365 0.3760596 0.06051614 466.9325 1
## 11 healthy.000 / acute_rejection.biopsy 0.2845231 0.05450156 466.8876 1
## 12 no_rejection.000 / no_rejection.007 2.1985110 0.25014764 416.4196 1
## 13 acute_rejection.007 / acute_rejection.090 0.4064421 0.05837297 342.5835 1
## 14 no_rejection.007 / no_rejection.090 0.4947163 0.06632764 397.0949 1
## t.ratio p.value
## 1 4.335020 1.799625e-05
## 2 -2.944658 3.407700e-03
## 3 3.512386 4.980771e-04
## 4 -6.943257 1.351482e-11
## 5 -2.212883 2.743133e-02
## 6 -3.688773 2.541721e-04
## 7 -7.843899 3.535142e-14
## 8 -7.855298 2.768706e-14
## 9 -6.471246 2.604160e-10
## 10 -6.077539 2.536799e-09
## 11 -6.561807 1.415371e-10
## 12 6.923686 1.673953e-11
## 13 -6.268748 1.094756e-09
## 14 -5.249198 2.493631e-07
## Patient-only, planned-measures-only models
model_data <- data_long %>%
filter(!is.na(il18_value),
group != 'healthy',
time_point != 'biopsy')
model_il18_value <- lmer(log10(il18_value) ~
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR <- lmer(log10(il18_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = FALSE)
model_il18_value_adjEGFR_REML <- lmer(log10(il18_value) ~ log2(egfr) +
group*time_point +
(1|id), data = model_data, REML = TRUE)
Anova(model_il18_value_adjEGFR_REML, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il18_value)
## F Df Df.res Pr(>F)
## log2(egfr) 0.2022 1 404.42 0.65323
## group 2.5078 1 127.57 0.11576
## time_point 38.4486 3 335.61 < 2e-16 ***
## group:time_point 2.9888 3 301.05 0.03135 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AIC(model_il18_value, model_il18_value_adjEGFR)
## df AIC
## model_il18_value 10 229.1316
## model_il18_value_adjEGFR 11 230.9228
BIC(model_il18_value, model_il18_value_adjEGFR)
## df BIC
## model_il18_value 10 269.6289
## model_il18_value_adjEGFR 11 275.4699Adjustment for renal function does not modify the results of the models explaining total IL-18. Markers of renal function do not clearly affect the above-shown patterns in total IL-18 levels and their difference across groups or time points
5.5 Renal function adjusment for other interleukins
5.5.1 IL-1a
Open code
model_data <- data_long %>%
filter(!is.na(il1_a_value))
## eGFR
model_il1a_value_adjEGFR <- lmer(log10(il1_a_value) ~ log10(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjEGFR, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_a_value)
## F Df Df.res Pr(>F)
## log10(egfr) 0.2508 1 448.08 0.6168
## group_sep 14.0826 9 424.92 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjEGFR)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_a_value) ~ log10(egfr) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 810.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5706 -0.3328 0.0706 0.5726 3.4989
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.0522 0.2285
## Residual 0.2390 0.4889
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.59087 0.12588 4.694
## log10(egfr) 0.04921 0.09778 0.503
## group_sephealthy.000 -1.01414 0.15615 -6.495
## group_sepno_rejection.000 0.01407 0.10247 0.137
## group_sepacute_rejection.007 -0.10838 0.11923 -0.909
## group_sepno_rejection.007 -0.11743 0.11338 -1.036
## group_sepacute_rejection.090 -0.06148 0.13337 -0.461
## group_sepno_rejection.090 0.15386 0.14583 1.055
## group_sepacute_rejection.365 -0.15750 0.13887 -1.134
## group_sepno_rejection.365 0.08960 0.14716 0.609
## group_sepacute_rejection.biopsy -0.08518 0.13180 -0.646
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log10(egfr) 0.730
## grp_sph.000 -0.865 -0.669
## grp_sp_.000 -0.570 0.005 0.459
## grp_spc_.007 -0.717 -0.416 0.611 0.505
## grp_spn_.007 -0.831 -0.428 0.704 0.683 0.637
## grp_spc_.090 -0.783 -0.565 0.677 0.453 0.625 0.653
## grp_spn_.090 -0.811 -0.559 0.699 0.530 0.589 0.720
## grp_spc_.365 -0.765 -0.559 0.662 0.436 0.608 0.636
## grp_spn_.365 -0.815 -0.570 0.703 0.525 0.590 0.721
## grp_spct_r. -0.637 -0.360 0.543 0.458 0.543 0.570
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log10(egfr)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.636
## grp_spc_.365 0.652 0.620
## grp_spn_.365 0.639 0.714 0.624
## grp_spct_r. 0.557 0.524 0.538 0.525
## creatinine
model_il1a_value_adjCRE <- lmer(log10(il1_a_value) ~ log10(creatinine) + group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjCRE, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_a_value)
## F Df Df.res Pr(>F)
## log10(creatinine) 0.1775 1 438.10 0.6737
## group_sep 14.0490 9 424.95 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjCRE)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_a_value) ~ log10(creatinine) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 810.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5795 -0.3285 0.0714 0.5658 3.5038
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.05241 0.2289
## Residual 0.23890 0.4888
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.68217 0.33612 2.030
## log10(creatinine) -0.04875 0.11514 -0.423
## group_sephealthy.000 -1.00550 0.15573 -6.457
## group_sepno_rejection.000 0.01335 0.10249 0.130
## group_sepacute_rejection.007 -0.10395 0.11876 -0.875
## group_sepno_rejection.007 -0.11364 0.11349 -1.001
## group_sepacute_rejection.090 -0.05490 0.13263 -0.414
## group_sepno_rejection.090 0.16040 0.14578 1.100
## group_sepacute_rejection.365 -0.15095 0.13837 -1.091
## group_sepno_rejection.365 0.09620 0.14727 0.653
## group_sepacute_rejection.biopsy -0.08125 0.13163 -0.617
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## lg10(crtnn) -0.967
## grp_sph.000 -0.786 0.667
## grp_sp_.000 -0.225 0.011 0.471
## grp_spc_.007 -0.550 0.408 0.607 0.513
## grp_spn_.007 -0.609 0.430 0.705 0.689 0.635
## grp_spc_.090 -0.679 0.559 0.674 0.464 0.622 0.653
## grp_spn_.090 -0.691 0.558 0.698 0.539 0.586 0.721
## grp_spc_.365 -0.670 0.555 0.659 0.446 0.605 0.635
## grp_spn_.365 -0.701 0.570 0.703 0.534 0.587 0.721
## grp_spct_r. -0.486 0.357 0.541 0.464 0.541 0.569
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## lg10(crtnn)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.633
## grp_spc_.365 0.649 0.619
## grp_spn_.365 0.637 0.715 0.622
## grp_spct_r. 0.555 0.523 0.536 0.524
## eGFR, simpler model (biopsy and healthy people not included)
model_data <- data_long %>%
filter(!is.na(il1_a_value)) %>%
filter(group != 'healthy',
time_point != 'biopsy')
model_il1a_value_adjEGFR_simple <- lmer(log10(il1_a_value) ~ log10(egfr) +
group*time_point+
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjEGFR_simple , type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_a_value)
## F Df Df.res Pr(>F)
## log10(egfr) 0.3780 1 384.61 0.53904
## group 1.7304 1 124.74 0.19078
## time_point 2.4112 3 342.61 0.06671 .
## group:time_point 1.5748 3 306.30 0.19546
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjEGFR_simple)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_a_value) ~ log10(egfr) + group * time_point + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 692.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5610 -0.2638 0.1095 0.5754 2.0922
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.05626 0.2372
## Residual 0.24024 0.4901
## Number of obs: 424, groups: id, 138
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.61840 0.11210 5.517
## log10(egfr) 0.06346 0.10267 0.618
## groupacute_rejection -0.01146 0.10341 -0.111
## time_point007 -0.13864 0.08810 -1.574
## time_point090 0.12741 0.12919 0.986
## time_point365 0.06280 0.13085 0.480
## groupacute_rejection:time_point007 0.01937 0.13015 0.149
## groupacute_rejection:time_point090 -0.20241 0.14674 -1.379
## groupacute_rejection:time_point365 -0.23654 0.15071 -1.570
##
## Correlation of Fixed Effects:
## (Intr) lg10() grpct_ tm_007 tm_090 tm_365 g_:_00 g_:_09
## log10(egfr) 0.865
## grpct_rjctn -0.278 -0.006
## time_pnt007 -0.764 -0.584 0.284
## time_pnt090 -0.753 -0.666 0.196 0.614
## time_pnt365 -0.760 -0.676 0.193 0.617 0.635
## grpct_:_007 0.171 -0.005 -0.653 -0.443 -0.149 -0.147
## grpct_:_090 0.197 0.049 -0.582 -0.226 -0.522 -0.196 0.461
## grpct_:_365 0.190 0.045 -0.568 -0.219 -0.191 -0.502 0.449 0.428There is sign that renal function affect also IL-1b, but it seems to be driven mainly by the difference of healthy subject. Analysis taking into account only planned measurements from patients does not show any indication that renal function affects the IL-1b levels.
5.5.2 IL-1b
Open code
model_data <- data_long %>%
filter(!is.na(il1_b_value))
## eGFR
model_il1a_value_adjEGFR <- lmer(log10(il1_b_value) ~ log2(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjEGFR, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_b_value)
## F Df Df.res Pr(>F)
## log2(egfr) 4.068 1 456.02 0.04429 *
## group_sep 61.108 9 423.94 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjEGFR)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_b_value) ~ log2(egfr) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -505.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.2625 -0.4773 -0.0856 0.2829 7.0731
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.003965 0.06297
## Residual 0.015843 0.12587
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 1.208704 0.032818 36.831
## log2(egfr) 0.015561 0.007677 2.027
## group_sephealthy.000 -0.653948 0.040717 -16.061
## group_sepno_rejection.000 0.047704 0.026709 1.786
## group_sepacute_rejection.007 -0.076621 0.030773 -2.490
## group_sepno_rejection.007 -0.039230 0.029556 -1.327
## group_sepacute_rejection.090 -0.080695 0.034498 -2.339
## group_sepno_rejection.090 -0.118658 0.037962 -3.126
## group_sepacute_rejection.365 -0.100288 0.035906 -2.793
## group_sepno_rejection.365 -0.135848 0.038308 -3.546
## group_sepacute_rejection.biopsy -0.071379 0.034038 -2.097
##
## Correlation of Fixed Effects:
## (Intr) lg2(g) g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log2(egfr) 0.730
## grp_sph.000 -0.865 -0.669
## grp_sp_.000 -0.570 0.005 0.459
## grp_spc_.007 -0.714 -0.420 0.609 0.498
## grp_spn_.007 -0.831 -0.428 0.704 0.688 0.632
## grp_spc_.090 -0.781 -0.570 0.676 0.445 0.627 0.649
## grp_spn_.090 -0.812 -0.559 0.699 0.535 0.587 0.725
## grp_spc_.365 -0.763 -0.563 0.660 0.429 0.610 0.631
## grp_spn_.365 -0.816 -0.570 0.704 0.530 0.588 0.725
## grp_spct_r. -0.635 -0.365 0.541 0.452 0.545 0.566
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log2(egfr)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.634
## grp_spc_.365 0.655 0.619
## grp_spn_.365 0.637 0.721 0.622
## grp_spct_r. 0.559 0.523 0.540 0.524
## creatinine
model_il1a_value_adjCRE <- lmer(log10(il1_b_value) ~ log10(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjCRE, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_b_value)
## F Df Df.res Pr(>F)
## log10(creatinine) 2.7495 1 446.23 0.09799 .
## group_sep 60.3320 9 423.99 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjCRE)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_b_value) ~ log10(creatinine) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: -506.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.2615 -0.4714 -0.0857 0.2670 7.0937
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.00400 0.06325
## Residual 0.01587 0.12598
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 1.30157 0.08782 14.822
## log10(creatinine) -0.05013 0.03009 -1.666
## group_sephealthy.000 -0.64390 0.04067 -15.833
## group_sepno_rejection.000 0.04697 0.02675 1.756
## group_sepacute_rejection.007 -0.07152 0.03069 -2.331
## group_sepno_rejection.007 -0.03479 0.02963 -1.174
## group_sepacute_rejection.090 -0.07309 0.03435 -2.128
## group_sepno_rejection.090 -0.11101 0.03800 -2.921
## group_sepacute_rejection.365 -0.09266 0.03582 -2.587
## group_sepno_rejection.365 -0.12811 0.03839 -3.337
## group_sepacute_rejection.biopsy -0.06672 0.03403 -1.961
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## lg10(crtnn) -0.967
## grp_sph.000 -0.786 0.667
## grp_sp_.000 -0.225 0.011 0.471
## grp_spc_.007 -0.552 0.413 0.606 0.506
## grp_spn_.007 -0.609 0.430 0.705 0.694 0.631
## grp_spc_.090 -0.682 0.564 0.672 0.456 0.624 0.649
## grp_spn_.090 -0.691 0.559 0.699 0.544 0.584 0.726
## grp_spc_.365 -0.672 0.559 0.658 0.439 0.607 0.631
## grp_spn_.365 -0.701 0.571 0.704 0.538 0.585 0.726
## grp_spct_r. -0.488 0.362 0.540 0.457 0.543 0.565
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## lg10(crtnn)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.632
## grp_spc_.365 0.652 0.617
## grp_spn_.365 0.636 0.721 0.621
## grp_spct_r. 0.557 0.521 0.538 0.5235.5.3 IL-1RA
Open code
model_data <- data_long %>%
filter(!is.na(il1_ra_value))
## eGFR
model_il1a_value_adjEGFR <- lmer(log10(il1_ra_value) ~ log10(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjEGFR, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_ra_value)
## F Df Df.res Pr(>F)
## log10(egfr) 0.4653 1 470.40 0.4955
## group_sep 8.3042 9 421.85 2.023e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjEGFR)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_ra_value) ~ log10(egfr) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 328.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.3940 -0.6108 -0.1123 0.4016 3.4038
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.02738 0.1655
## Residual 0.08423 0.2902
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.13755 0.07772 40.371
## log10(egfr) -0.04137 0.06036 -0.685
## group_sephealthy.000 -0.53522 0.09648 -5.548
## group_sepno_rejection.000 0.11692 0.06331 1.847
## group_sepacute_rejection.007 -0.10081 0.07132 -1.414
## group_sepno_rejection.007 -0.04691 0.07004 -0.670
## group_sepacute_rejection.090 -0.08009 0.08032 -0.997
## group_sepno_rejection.090 -0.03197 0.08963 -0.357
## group_sepacute_rejection.365 -0.25535 0.08352 -3.057
## group_sepno_rejection.365 -0.14293 0.09045 -1.580
## group_sepacute_rejection.biopsy -0.15165 0.07898 -1.920
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log10(egfr) 0.730
## grp_sph.000 -0.864 -0.669
## grp_sp_.000 -0.570 0.005 0.459
## grp_spc_.007 -0.709 -0.429 0.605 0.483
## grp_spn_.007 -0.831 -0.428 0.704 0.700 0.622
## grp_spc_.090 -0.776 -0.580 0.672 0.430 0.632 0.640
## grp_spn_.090 -0.813 -0.559 0.700 0.546 0.583 0.735
## grp_spc_.365 -0.757 -0.571 0.656 0.415 0.614 0.622
## grp_spn_.365 -0.818 -0.570 0.705 0.541 0.584 0.735
## grp_spct_r. -0.631 -0.374 0.538 0.437 0.548 0.557
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log10(egfr)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.630
## grp_spc_.365 0.660 0.615
## grp_spn_.365 0.634 0.734 0.618
## grp_spct_r. 0.563 0.519 0.543 0.521
## creatinine
model_il1a_value_adjCRE <- lmer(log10(il1_ra_value) ~ log10(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjCRE, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il1_ra_value)
## F Df Df.res Pr(>F)
## log10(creatinine) 0.0078 1 462.27 0.9297
## group_sep 8.9721 9 421.86 1.995e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjCRE)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il1_ra_value) ~ log10(creatinine) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 328.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.3834 -0.5928 -0.1123 0.4084 3.4424
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.02789 0.1670
## Residual 0.08402 0.2899
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.158535 0.207991 15.186
## log10(creatinine) 0.006321 0.071263 0.089
## group_sephealthy.000 -0.573670 0.096359 -5.953
## group_sepno_rejection.000 0.117247 0.063387 1.850
## group_sepacute_rejection.007 -0.119046 0.070992 -1.677
## group_sepno_rejection.007 -0.064707 0.070193 -0.922
## group_sepacute_rejection.090 -0.107868 0.079840 -1.351
## group_sepno_rejection.090 -0.061912 0.089676 -0.690
## group_sepacute_rejection.365 -0.283766 0.083182 -3.411
## group_sepno_rejection.365 -0.173723 0.090600 -1.917
## group_sepacute_rejection.biopsy -0.169353 0.078809 -2.149
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## lg10(crtnn) -0.967
## grp_sph.000 -0.786 0.667
## grp_sp_.000 -0.225 0.011 0.470
## grp_spc_.007 -0.557 0.423 0.601 0.490
## grp_spn_.007 -0.609 0.430 0.704 0.707 0.620
## grp_spc_.090 -0.688 0.575 0.669 0.440 0.629 0.639
## grp_spn_.090 -0.692 0.559 0.700 0.555 0.580 0.736
## grp_spc_.365 -0.676 0.568 0.653 0.424 0.612 0.621
## grp_spn_.365 -0.702 0.571 0.705 0.550 0.581 0.737
## grp_spct_r. -0.493 0.371 0.536 0.442 0.546 0.556
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## lg10(crtnn)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.628
## grp_spc_.365 0.658 0.613
## grp_spn_.365 0.632 0.735 0.617
## grp_spct_r. 0.562 0.518 0.542 0.5195.5.4 IL-36b
Open code
model_data <- data_long %>%
filter(!is.na(il36_b_value))
## eGFR
model_il1a_value_adjEGFR <- lmer(log10(il36_b_value) ~ log10(egfr) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjEGFR, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il36_b_value)
## F Df Df.res Pr(>F)
## log10(egfr) 1.2217 1 483.16 0.2696
## group_sep 8.4246 9 419.14 1.351e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjEGFR)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il36_b_value) ~ log10(egfr) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 568.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.3793 -0.3393 0.0062 0.4159 3.1391
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.05723 0.2392
## Residual 0.13052 0.3613
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.79008 0.10017 7.888
## log10(egfr) 0.08612 0.07756 1.110
## group_sephealthy.000 -0.61267 0.12450 -4.921
## group_sepno_rejection.000 0.05215 0.08193 0.637
## group_sepacute_rejection.007 -0.21287 0.08935 -2.382
## group_sepno_rejection.007 -0.09445 0.09054 -1.043
## group_sepacute_rejection.090 -0.43449 0.10119 -4.294
## group_sepno_rejection.090 -0.20903 0.11514 -1.816
## group_sepacute_rejection.365 -0.59760 0.10510 -5.686
## group_sepno_rejection.365 -0.26376 0.11619 -2.270
## group_sepacute_rejection.biopsy -0.54970 0.09906 -5.549
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## log10(egfr) 0.728
## grp_sph.000 -0.863 -0.666
## grp_sp_.000 -0.571 0.004 0.459
## grp_spc_.007 -0.700 -0.440 0.599 0.463
## grp_spn_.007 -0.830 -0.426 0.702 0.716 0.608
## grp_spc_.090 -0.769 -0.592 0.666 0.410 0.637 0.625
## grp_spn_.090 -0.815 -0.558 0.701 0.562 0.576 0.748
## grp_spc_.365 -0.750 -0.582 0.650 0.396 0.620 0.608
## grp_spn_.365 -0.819 -0.569 0.705 0.557 0.578 0.748
## grp_spct_r. -0.624 -0.385 0.533 0.418 0.552 0.544
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## log10(egfr)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.624
## grp_spc_.365 0.667 0.608
## grp_spn_.365 0.628 0.750 0.612
## grp_spct_r. 0.569 0.514 0.548 0.516
## creatinine
model_il1a_value_adjCRE <- lmer(log10(il36_b_value) ~ log10(creatinine) +
group_sep +
(1|id), data = model_data, REML = TRUE)
Anova(model_il1a_value_adjCRE, type=2, test.statistic='F')
## Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
##
## Response: log10(il36_b_value)
## F Df Df.res Pr(>F)
## log10(creatinine) 1.2973 1 476.64 0.2553
## group_sep 8.5405 9 419.43 9.023e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_il1a_value_adjCRE)
## Linear mixed model fit by REML ['lmerMod']
## Formula: log10(il36_b_value) ~ log10(creatinine) + group_sep + (1 | id)
## Data: model_data
##
## REML criterion at convergence: 568
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.3743 -0.3401 0.0088 0.4210 3.1406
##
## Random effects:
## Groups Name Variance Std.Dev.
## id (Intercept) 0.0573 0.2394
## Residual 0.1305 0.3612
## Number of obs: 500, groups: id, 186
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 1.00492 0.26750 3.757
## log10(creatinine) -0.10485 0.09163 -1.144
## group_sephealthy.000 -0.61509 0.12429 -4.949
## group_sepno_rejection.000 0.05079 0.08193 0.620
## group_sepacute_rejection.007 -0.21331 0.08900 -2.397
## group_sepno_rejection.007 -0.09601 0.09064 -1.059
## group_sepacute_rejection.090 -0.43544 0.10062 -4.327
## group_sepno_rejection.090 -0.21118 0.11512 -1.834
## group_sepacute_rejection.365 -0.59895 0.10472 -5.719
## group_sepno_rejection.365 -0.26624 0.11631 -2.289
## group_sepacute_rejection.biopsy -0.55056 0.09889 -5.567
##
## Correlation of Fixed Effects:
## (Intr) lg10() g_.000 g__.000 grp_spc_.007 grp_spn_.007
## lg10(crtnn) -0.966
## grp_sph.000 -0.784 0.664
## grp_sp_.000 -0.225 0.010 0.470
## grp_spc_.007 -0.562 0.433 0.595 0.471
## grp_spn_.007 -0.608 0.428 0.703 0.721 0.607
## grp_spc_.090 -0.694 0.586 0.663 0.421 0.634 0.626
## grp_spn_.090 -0.692 0.558 0.700 0.570 0.574 0.749
## grp_spc_.365 -0.681 0.578 0.648 0.406 0.617 0.609
## grp_spn_.365 -0.703 0.570 0.705 0.565 0.576 0.749
## grp_spct_r. -0.498 0.382 0.531 0.425 0.550 0.544
## grp_spc_.090 grp_spn_.090 grp_spc_.365 grp_spn_.365
## lg10(crtnn)
## grp_sph.000
## grp_sp_.000
## grp_spc_.007
## grp_spn_.007
## grp_spc_.090
## grp_spn_.090 0.622
## grp_spc_.365 0.664 0.607
## grp_spn_.365 0.627 0.750 0.611
## grp_spct_r. 0.567 0.513 0.546 0.5146 IL18 forms plot
At first, we need to transform IL-18 levels to molar concentration (pM/L)
Open code
data_long <- data_long %>%
mutate( il18bp_pM = (((il18_bp_value/1e12)*1000) / 19000)*1e12,
il18tot_pM = (((il18_value/1e12)*1000) / 17200)*1e12,
il18free_pM = (((il18_free/1e12)*1000) / 17200) *1e12)Now, we can create plots to demonstrate the relationship between IL-18BP levels and IL-18 levels (both free and total). We will concentrate on healthy individuals and the initial measurement from the group without rejection, noted for its significant variability in IL-18BP and IL-18 levels. The plots will display examples showcasing both minimal and very high IL-18 binding.
6.1 Individual plots per selected groups
Open code
## prepare data
il18d <- data_long %>%
filter(!is.na(il18_value),
!is.na(il18_bp_value),
!is.na(il18_free)) %>%
mutate(group = factor(group, levels =
c("no_rejection",
"acute_rejection",
"healthy")),
time_point = factor(time_point)) %>%
mutate(time_point = if_else(group == 'healthy', 'healthy', time_point)) %>%
mutate(group_sep = interaction(group, time_point))
## Plot for healthy
p18_healthy <- il18d %>%
filter(group_sep == 'healthy.healthy') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(ylim = c(0, NA)) +
ggtitle("Samples from healthy donors")
p18_healthyOpen code
## plot for D0, group without rejection
p18_no_reject_0 <- il18d %>%
filter(group_sep == 'no_rejection.000') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(ylim = c(0, NA)) +
ggtitle("No rejection group, the 1st measurement")
p18_no_reject_0Open code
## plot for D0, group with rejection
p18_acute_reject_0 <- il18d %>%
filter(group_sep == 'acute_rejection.000') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(ylim = c(0, NA)) +
ggtitle("Acute rejection group, the 1st measurement")
## plot for D90, group without rejection
p18_no_reject_90 <- il18d %>%
filter(group_sep == 'no_rejection.090') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(ylim = c(0, NA)) +
ggtitle("No rejection group, day 90")
## plot for biopsy measurement, rejection group
p18_acute_reject_biopsy <- il18d %>%
filter(group_sep == 'acute_rejection.biopsy') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(ylim = c(0, NA)) +
ggtitle("Rejection group, day of biopsy")
p18_acute_reject_biopsy6.2 acute/no rejection difference
Open code
il18d <- il18d %>%
mutate(free_ratio = il18free_pM/il18tot_pM)
ymax = 580
xmax = 500
xmin = 0
p1 <- il18d %>%
filter(group_sep == 'no_rejection.090') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(xlim = c(xmin, xmax), ylim = c(0, ymax)) +
ggtitle("No rejection, day 90") +
theme(legend.position = 'none')
p2 <- il18d %>%
filter(group_sep == 'acute_rejection.biopsy') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(xlim = c(xmin, xmax), ylim = c(0, ymax)) +
ggtitle("Rejection, day of biopsy")+
theme(legend.position = c(0.85, 0.9))
## Warning: A numeric `legend.position` argument in `theme()` was deprecated in ggplot2
## 3.5.0.
## ℹ Please use the `legend.position.inside` argument of `theme()` instead.
p3 <- il18d %>%
filter(group_sep == 'no_rejection.000') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(xlim = c(xmin, xmax), ylim = c(0, ymax)) +
ggtitle("No rejection, before TX") +
theme(legend.position = 'none')
p4 <- il18d %>%
filter(group_sep == 'acute_rejection.000') %>%
ggplot(aes(x = il18bp_pM)) +
geom_point(aes(y = il18free_pM, color = "IL-18 Free")) +
geom_point(aes(y = il18tot_pM, color = "IL-18 Total"), pch=1) +
geom_line(data = . %>%
select(il18bp_pM, il18free_pM, il18tot_pM) %>%
pivot_longer(cols = -il18bp_pM,
names_to = "variable", values_to = "value"),
aes(x = il18bp_pM, y = value, group = il18bp_pM), col = 'grey20') +
scale_color_manual(values = c("IL-18 Free" = "blue", "IL-18 Total" = "red")) +
labs(x = "IL-18BP (pM)", y = "IL-18 (pM)", color = "") +
coord_cartesian(xlim = c(xmin, xmax), ylim = c(0, ymax)) +
ggtitle("Rejection, before TX")+
theme(legend.position = 'none')
fig12 <- plot_grid(p3, p4, p1, p2)
if(file.exists('gitignore/figures/fig12.pdf') == FALSE){
ggsave("gitignore/figures/fig12.pdf",
plot = fig12, width = 8, height = 8, units = "in")
}
plotac <- 'fig12'
path = paste0('gitignore/figures/',plotac, '.pdf')
if(file.exists(path) == FALSE){
ggsave(path,
plot = get(plotac), width = 8, height = 8, units = "in")
}
fig127 Prediction of rejection with D90 data
7.1 Data preparation
Open code
wdat <- data_long %>%
filter(group_sep == 'no_rejection.090' |
group_sep == 'acute_rejection.biopsy') %>%
mutate(group = factor(group)) %>%
select(-group)
wpdat <- patient_table %>%
select(id, donor_age, dsa, anti_hla, TX_order, group, MT_minutes, induction_therapy) %>%
mutate(anti_hla = if_else(is.na(anti_hla), '0', anti_hla)) %>%
mutate(anti_hla = if_else(anti_hla == 'pos', 1, 0),
TX_order = factor(if_else(TX_order == 1, '1', '2+')),
rejection = if_else(group == 'no_rejection', 0, 1))
wdat <- wdat %>%
left_join(wpdat, by = 'id')
summary(wdat)
## id time_point id_obs il1_a_value
## Length:115 000 : 0 Length:115 Min. : 0.1751
## Class :character 007 : 0 Class :character 1st Qu.: 3.2823
## Mode :character 090 :87 Mode :character Median : 4.7830
## 365 : 0 Mean : 5.1383
## biopsy:28 3rd Qu.: 6.3253
## Max. :14.5740
## NA's :48
## il1_b_value il1_ra_value il18_value il18_bp_value
## Min. : 8.505 Min. : 390.9 Min. : 204.2 Min. :1638
## 1st Qu.:11.397 1st Qu.: 735.0 1st Qu.: 447.3 1st Qu.:2858
## Median :12.358 Median : 1008.2 Median : 629.8 Median :3353
## Mean :12.693 Mean : 1648.9 Mean : 827.8 Mean :3387
## 3rd Qu.:13.584 3rd Qu.: 1616.0 3rd Qu.: 939.4 3rd Qu.:3761
## Max. :24.261 Max. :10180.2 Max. :7455.6 Max. :6011
## NA's :48 NA's :48 NA's :48
## il18_bp_ratio il18_free il36_b_value creatinine
## Min. : 22.04 Min. : 137.3 Min. : 0.0258 Min. : 60.6
## 1st Qu.: 52.01 1st Qu.: 316.2 1st Qu.: 2.2833 1st Qu.:113.5
## Median : 69.29 Median : 434.1 Median : 3.2191 Median :144.0
## Mean : 99.87 Mean : 571.5 Mean : 4.3440 Mean :177.4
## 3rd Qu.: 112.00 3rd Qu.: 655.0 3rd Qu.: 4.4641 3rd Qu.:206.5
## Max. :1067.76 Max. :5452.0 Max. :37.1179 Max. :804.6
## NA's :48 NA's :48 NA's :48
## egfr group_sep il18bp_pM il18tot_pM
## Min. :0.0900 no_rejection.090 :87 Min. : 86.21 Min. : 11.87
## 1st Qu.:0.4900 acute_rejection.biopsy:28 1st Qu.:150.39 1st Qu.: 26.01
## Median :0.7400 acute_rejection.000 : 0 Median :176.47 Median : 36.62
## Mean :0.7373 healthy.000 : 0 Mean :178.28 Mean : 48.13
## 3rd Qu.:0.9350 no_rejection.000 : 0 3rd Qu.:197.95 3rd Qu.: 54.62
## Max. :1.7800 acute_rejection.007 : 0 Max. :316.36 Max. :433.47
## (Other) : 0 NA's :48
## il18free_pM donor_age dsa anti_hla TX_order
## Min. : 7.98 Min. : 1.00 Length:115 Min. :0.0000 1 :107
## 1st Qu.: 18.39 1st Qu.:46.00 Class :character 1st Qu.:0.0000 2+: 8
## Median : 25.24 Median :56.00 Mode :character Median :0.0000
## Mean : 33.23 Mean :53.76 Mean :0.2435
## 3rd Qu.: 38.08 3rd Qu.:65.00 3rd Qu.:0.0000
## Max. :316.98 Max. :81.00 Max. :1.0000
## NA's :48
## group MT_minutes induction_therapy rejection
## Length:115 Min. : 7.00 ATG :69 Min. :0.0000
## Class :character 1st Qu.:19.00 ATG,PE,IVIG:13 1st Qu.:0.0000
## Mode :character Median :24.00 basiliximab:33 Median :0.0000
## Mean :25.63 Mean :0.2435
## 3rd Qu.:31.50 3rd Qu.:0.0000
## Max. :57.00 Max. :1.0000
## 7.2 Il18bp model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il18_bp_value))
model <- glm(rejection ~
dsa +
TX_order +
log2(il18_bp_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il18_bp_value))
AIC(model) - AIC(basemod)
## [1] -6.095499
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 87 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6396
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 87 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.7529
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -2.43, p-value = 0.0151
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.20468627 -0.02191472
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6395731 0.7528736
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 1.89 | 0.3009 |
| TX_order2+ | 18.35 | 0.0134 |
| log2(il18_bp_value) | 10.95 | 0.0074 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
#anti_hla +
TX_order +
#induction_therapy +
log2(il18_bp_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il18_bp_value))
AIC(model_egfr) - AIC(basemod)
## [1] -2.600126
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 87 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.9039
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 87 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.908
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -0.36577, p-value = 0.7145
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.02610194 0.01789176
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.9039409 0.9080460
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.002 | 0.0000 |
| dsapos | 0.699 | 0.6424 |
| TX_order2+ | 24.597 | 0.0128 |
| log2(il18_bp_value) | 13.315 | 0.0457 |
7.3 Il-1a model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il1_a_value))
model <- glm(rejection ~
dsa +
TX_order +
log2(il1_a_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il1_a_value))
AIC(model) - AIC(basemod)
## [1] -13.18607
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8187
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -3.4108, p-value = 0.0006477
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.30137233 -0.08141155
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6272894 0.8186813
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 0.93 | 0.9305 |
| TX_order2+ | 10.07 | 0.0649 |
| log2(il1_a_value) | 0.16 | 0.0016 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
TX_order +
log2(il1_a_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il1_a_value))
AIC(model_egfr) - AIC(basemod)
## [1] -7.859227
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.9212
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -1.3675, p-value = 0.1715
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.06684631 0.01190125
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.8937729 0.9212454
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.006 | 0.0006 |
| dsapos | 0.315 | 0.2820 |
| TX_order2+ | 17.208 | 0.0503 |
| log2(il1_a_value) | 0.148 | 0.0153 |
7.4 Il-1b model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il1_b_value))
model <- glm(rejection ~
dsa +
TX_order +
log2(il1_b_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il1_b_value))
AIC(model) - AIC(basemod)
## [1] 1.018489
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6571
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -0.67843, p-value = 0.4975
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.11574368 0.05621987
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6272894 0.6570513
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 1.97 | 0.3237 |
| TX_order2+ | 7.45 | 0.0920 |
| log2(il1_b_value) | 2.84 | 0.3261 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
TX_order +
log2(il1_b_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il1_b_value))
AIC(model_egfr) - AIC(basemod)
## [1] 1.508244
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8993
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -0.78412, p-value = 0.433
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.019228328 0.008239317
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.8937729 0.8992674
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.004 | 0.0002 |
| dsapos | 0.675 | 0.6340 |
| TX_order2+ | 10.357 | 0.0676 |
| log2(il1_b_value) | 2.778 | 0.4863 |
7.5 Il-18 total model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il18_value))
model <- glm(rejection ~
dsa +
TX_order +
log2(il18_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il18_value))
AIC(model) - AIC(basemod)
## [1] 1.926523
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = 0, p-value = 1
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.08946882 0.08946882
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6272894 0.6272894
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 1.91 | 0.3451 |
| TX_order2+ | 7.95 | 0.0835 |
| log2(il18_value) | 1.09 | 0.7858 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
TX_order +
log2(il18_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il18_value))
AIC(model_egfr) - AIC(basemod)
## [1] 1.874584
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8901
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = 0.83957, p-value = 0.4011
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.004888199 0.012214206
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.8937729 0.8901099
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.004 | 0.0001 |
| dsapos | 0.651 | 0.6069 |
| TX_order2+ | 10.552 | 0.0669 |
| log2(il18_value) | 1.172 | 0.7216 |
7.6 Il-18free model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il18_free))
model <- glm(rejection ~
dsa +
TX_order +
log2(il18_free),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il18_free))
AIC(model) - AIC(basemod)
## [1] 1.999061
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6236
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = 0.080581, p-value = 0.9358
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.08543186 0.09275787
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6272894 0.6236264
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 1.88 | 0.3573 |
| TX_order2+ | 8.28 | 0.0782 |
| log2(il18_free) | 1.01 | 0.9755 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
TX_order +
log2(il18_free),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il18_free))
AIC(model_egfr) - AIC(basemod)
## [1] 1.96952
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = 0, p-value = 1
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.007059397 0.007059397
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.8937729 0.8937729
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.004 | 0.0001 |
| dsapos | 0.645 | 0.5983 |
| TX_order2+ | 10.920 | 0.0633 |
| log2(il18_free) | 1.081 | 0.8610 |
7.7 Il-36b model
Open code
wdat_sbs <- wdat %>% filter(!is.na(il36_b_value))
model <- glm(rejection ~
dsa +
TX_order +
log2(il36_b_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model, ~ . -log2(il36_b_value))
AIC(model) - AIC(basemod)
## [1] -2.638931
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model)),
reject = model$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.6273
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.7253
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -1.5905, p-value = 0.1117
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.21872871 0.02275802
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.6272894 0.7252747
tr <- summary(model)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]),2)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| dsapos | 1.28 | 0.7314 |
| TX_order2+ | 6.75 | 0.1157 |
| log2(il36_b_value) | 0.64 | 0.0683 |
Open code
model_egfr <- glm(rejection ~
egfr +
dsa +
TX_order +
log2(il36_b_value),
data = wdat_sbs,
family = binomial(link = 'logit'))
basemod <- update(model_egfr, ~ . -log2(il36_b_value))
AIC(model_egfr) - AIC(basemod)
## [1] 1.302194
tr <- data.frame(pred_b = as.numeric(predict(basemod)),
pred = as.numeric(predict(model_egfr)),
reject = model_egfr$model$rejection)
auc1 <- roc(response = tr$reject, predictor = tr$pred_b)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc1
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred_b)
##
## Data: tr$pred_b in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.8938
auc2 <- roc(response = tr$reject, predictor = tr$pred)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
auc2
##
## Call:
## roc.default(response = tr$reject, predictor = tr$pred)
##
## Data: tr$pred in 39 controls (tr$reject 0) < 28 cases (tr$reject 1).
## Area under the curve: 0.9011
roc.test(auc1, auc2)
##
## DeLong's test for two correlated ROC curves
##
## data: auc1 and auc2
## Z = -1.0421, p-value = 0.2974
## alternative hypothesis: true difference in AUC is not equal to 0
## 95 percent confidence interval:
## -0.021105022 0.006453007
## sample estimates:
## AUC of roc1 AUC of roc2
## 0.8937729 0.9010989
tr <- summary(model_egfr)$coefficients[-1, c(1,4)]
colnames(tr)[1] <- 'Odds ratio'
tr[,1] <- round(exp(tr[,1]), 3)
tr[,2] <- round(tr[,2], 4)
kableExtra::kable(tr)| Odds ratio | Pr(>|z|) | |
|---|---|---|
| egfr | 0.005 | 0.0003 |
| dsapos | 0.542 | 0.4816 |
| TX_order2+ | 10.437 | 0.0713 |
| log2(il36_b_value) | 0.815 | 0.4359 |
8 Reproducibility
Open code
sessionInfo()
## R version 4.4.0 (2024-04-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.4 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=cs_CZ.UTF-8 LC_COLLATE=en_US.UTF-8
## [5] LC_MONETARY=cs_CZ.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=cs_CZ.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=cs_CZ.UTF-8 LC_IDENTIFICATION=C
##
## time zone: Europe/Prague
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] rstudioapi_0.16.0 quantreg_5.97 SparseM_1.81 coxed_0.3.3
## [5] survival_3.5-8 rms_6.8-0 Hmisc_5.1-2 bayesplot_1.8.1
## [9] ggdist_3.3.2 kableExtra_1.4.0 lubridate_1.8.0 corrplot_0.92
## [13] arm_1.12-2 lme4_1.1-35.3 MASS_7.3-60 janitor_2.2.0
## [17] RJDBC_0.2-10 rJava_1.0-6 DBI_1.1.2 projpred_2.0.2
## [21] brms_2.21.0 Rcpp_1.0.12 glmnet_4.1-3 Matrix_1.7-0
## [25] boot_1.3-30 cowplot_1.1.1 pROC_1.18.0 mgcv_1.9-1
## [29] nlme_3.1-163 openxlsx_4.2.5 flextable_0.9.6 sjPlot_2.8.16
## [33] car_3.0-12 carData_3.0-5 gtsummary_1.7.2 emmeans_1.7.2
## [37] ggpubr_0.4.0 forcats_1.0.0 stringr_1.4.0 dplyr_1.1.4
## [41] purrr_1.0.2 readr_2.1.2 tidyr_1.2.0 tibble_3.2.1
## [45] ggplot2_3.5.1 tidyverse_1.3.1
##
## loaded via a namespace (and not attached):
## [1] splines_4.4.0 later_1.3.0 gamm4_0.2-6
## [4] polspline_1.1.25 cellranger_1.1.0 datawizard_0.10.0
## [7] rpart_4.1.23 reprex_2.0.1 lifecycle_1.0.4
## [10] rstatix_0.7.0 StanHeaders_2.32.8 processx_3.5.2
## [13] lattice_0.22-5 insight_0.19.11 backports_1.4.1
## [16] magrittr_2.0.2 sass_0.4.9 rmarkdown_2.27
## [19] yaml_2.3.5 httpuv_1.6.5 zip_2.2.0
## [22] askpass_1.1 pkgbuild_1.3.1 minqa_1.2.4
## [25] multcomp_1.4-18 abind_1.4-5 rvest_1.0.2
## [28] nnet_7.3-19 TH.data_1.1-0 tensorA_0.36.2
## [31] sandwich_3.0-1 gdtools_0.3.7 pbkrtest_0.5.1
## [34] inline_0.3.19 crul_1.4.2 MatrixModels_0.5-3
## [37] performance_0.11.0 bridgesampling_1.1-2 commonmark_1.9.1
## [40] svglite_2.1.0 codetools_0.2-19 xml2_1.3.3
## [43] tidyselect_1.2.1 shape_1.4.6 farver_2.1.0
## [46] ggeffects_1.6.0 httpcode_0.3.0 base64enc_0.1-3
## [49] matrixStats_0.61.0 stats4_4.4.0 broom.helpers_1.15.0
## [52] jsonlite_1.7.3 Formula_1.2-4 ellipsis_0.3.2
## [55] ggridges_0.5.3 iterators_1.0.14 systemfonts_1.0.4
## [58] foreach_1.5.2 tools_4.4.0 ragg_1.2.1
## [61] glue_1.7.0 gridExtra_2.3 xfun_0.44
## [64] distributional_0.4.0 loo_2.4.1 withr_3.0.0
## [67] fastmap_1.2.0 fansi_1.0.2 openssl_1.4.6
## [70] callr_3.7.0 digest_0.6.29 R6_2.5.1
## [73] mime_0.12 estimability_1.3 textshaping_0.3.6
## [76] colorspace_2.0-2 markdown_1.12 utf8_1.2.2
## [79] generics_0.1.2 fontLiberation_0.1.0 data.table_1.14.2
## [82] prettyunits_1.1.1 httr_1.4.2 htmlwidgets_1.6.4
## [85] pkgconfig_2.0.3 gtable_0.3.0 htmltools_0.5.8.1
## [88] fontBitstreamVera_0.1.1 scales_1.3.0 posterior_1.2.0
## [91] snakecase_0.11.1 knitr_1.46 tzdb_0.2.0
## [94] uuid_1.0-3 coda_0.19-4 checkmate_2.0.0
## [97] curl_4.3.2 nloptr_2.0.0 zoo_1.8-9
## [100] sjlabelled_1.2.0 parallel_4.4.0 foreign_0.8-86
## [103] pillar_1.9.0 grid_4.4.0 vctrs_0.6.5
## [106] promises_1.2.0.1 dbplyr_2.1.1 cluster_2.1.6
## [109] xtable_1.8-4 htmlTable_2.4.0 evaluate_0.15
## [112] mvtnorm_1.1-3 cli_3.6.2 compiler_4.4.0
## [115] rlang_1.1.3 crayon_1.5.0 rstantools_2.1.1
## [118] ggsignif_0.6.3 labeling_0.4.2 modelr_0.1.8
## [121] ps_1.6.0 plyr_1.8.6 sjmisc_2.8.10
## [124] fs_1.6.4 stringi_1.7.6 rstan_2.32.6
## [127] viridisLite_0.4.0 QuickJSR_1.1.3 assertthat_0.2.1
## [130] munsell_0.5.0 Brobdingnag_1.2-7 V8_4.4.2
## [133] fontquiver_0.2.1 sjstats_0.19.0 hms_1.1.1
## [136] gfonts_0.2.0 shiny_1.8.1.1 haven_2.4.3
## [139] gt_0.10.1 broom_1.0.6 RcppParallel_5.1.5
## [142] readxl_1.3.1 officer_0.6.6